From Xojo Documentation
Fires in response to a RequestDeviceLocation() call.
The parameters are as follows:
- Latitude and longitude are the geographic coordinates in decimal degrees.
- Accuracy is the accuracy level of latitude and longitude, in meters. The value is a non-negative real number.
- Altitude is the height of the position, in meters above the [WGS84] ellipsoid.
- AltitudeAccuracy attribute is specified in meters. AltitudeAccuracy is a non-negative real number.
- Heading is the direction of travel of the device, in degrees, where 0° ≤ heading < 360°, counting clockwise relative to the true north.
- Speed is magnitude of the horizontal component of the device’s current velocity, in meters per second. The value of the speed attribute must be a non-negative real number.
- Timestamp is date/time stamp when the position was acquired and is converted to local time.
For Accuracy, Altitude, AltitudeAccuracy, Heading, and Speed, if no value is specified the value will be -1. This is the case, for example, if the device is a desktop computer.
This code in a Button's Action event requests location data:
The DeviceLocation instance in the WebPage gets the new latitude and longitude in its DeviceLocation event and uses it to recenter a map with this line of code:
Any errors in the request triggers the Error event of the DeviceLocation instance: