From Xojo Documentation
The Location control provides a way for you to get location information for the device. This is not a visual control, so dragging it appears on the Shelf when dragged to the layout.
Use the Debug ↠ Location menu in the iOS Simulator to provide locations for testing.
Frequently getting the location can cause significant battery drain, so only be sure to set Enabled = False when it is not needed.
Below is a list of commonly used events, properties and methods. Refer to iOSLocation in the Language Reference for the complete list.
- Called when a location update is received from iOS.
- Specifies the level of accuracy for the location using the Accuracies enum. The "Best" accuracy is used by default, but you can increase or decrease the accuracy as necessary to manage battery usage.
- Indicates the level of authorization that is allowed for location. Check this before enabling.
- When enabled is True, the LocationChanged event is called with location updates. You should set this to False when the location is not needed.
- Request approval to use the location at any time.
- Requests approval to use location when the app is active.
Before you can get the location you must request authorization. This is typically done like this:
// we've got our requested authorization state, start getting LocationChanged events
MyLocation.Enabled = True
// we don't have authorization yet, so ask for it
Once the control is enabled you will start getting LocationChanged events when the location is updated.