cfclient.geolocation.getOptions

Getting Geolocation options

You can get the current Geolocation options using the getOptions() function.

Method summary

getOptions()

  • returns – An object representing the Options object
  • params
    •  None

For instance,

<cfscript>
opt=cfclient.geolocation.getOptions();
/*Populating the content of the <div> with the ID divId*/
document.getElementById('divId').innerHTML=" Enable high accuracy: "+opt.enableHighAccuracy);
document.getElementById('divId').innerHTML=" Maximum age: "+opt.maximumAge);
document.getElementById('divId').innerHTML=" Maximum age: "+opt.maximumAge);

</cfscript>


Geolocation Options structure

The Geolocation Options object contains the following parameters:

  • enableHighAccuracy (Boolean) - By default, the device attempts to retrieve a position using the network-based methods. Setting this property to true enables ColdFusion to use more accurate methods, such as satellite positioning.
  • timeOut (Number) – The maximum time length (milliseconds) that is allowed to pass from the call to getCurrentPosition or watchPosition until the corresponding geolocationSuccess callback gets executed.
  • maximumAge (Number) - Accept a cached position whose age is no greater than the specified time in milliseconds.

Example

See Using the Geolocation APIs

Get help faster and easier

New user?