WebDeviceLocation.RequestDeviceLocation

From Xojo Documentation

Method

WebDeviceLocation.RequestDeviceLocation()

New in 2011r2

Supported for all project types and targets.

Requests the location of the user's device. If the device supports HTML5 Geolocation, the user will be asked whether or not to supply their location to you. If the user agrees, the DeviceLocation event will be fired. If the user disagrees or an error occurs, a WebDeviceLocation.Error event will fire.


Method

WebDeviceLocation.RequestDeviceLocation(Timeout As Integer, MaximumAge As Integer = 60000, HighPrecision As Boolean = False)

New in 2011r2

Supported for all project types and targets.

Same as above, but allows you to specify the Timeout, MaximumAge, and HighPrecision properties. Setting HighPrecision to True may require more time and will increase the power usage on the user's device.

Notes

Requesting the device location uses CPU cycles and power. Be very careful about requesting the user's location too often for mobile devices or you can cause excessive battery drain. You can use the WebDeviceLocation.MaximumAge property (or the second method syntax above) to prevent the device from requesting new information too often. If it is prohibited from requesting new information, it will simply report the most recent values instead.