Web Device Location
From Xojo Documentation
Contents
Use Device Location to access the HTML5 GeoLocation capabilities provided by the browser (if supported).
Events
- After calling the RequestDeviceLocation method, this method is called with the information about the location. If the location could not be determined, then the Error event is called instead.
Methods
- Asks the browser to request the device's location. Calls the DeviceLocation event if the location can be determined, otherwise calls the Error event.
Usage
The RequestDeviceLocation method asks the browser for the location:
DeviceLocation1.RequestDeviceLocation
The WebDeviceLocation object's DeviceLocation event is called with the location. This code displays the latitude and longitude:
Label1.Text = "Latitude=" + latitude.ToString + ", Longitude=" + longitude.ToString
See Also
WebDeviceLocation class; UserGuide:Web UI topic