Skip to content



The TMSFMXNativeCLLocationManager component is the central point for configuring the delivery of location- and heading-related events to your app. You use this component to establish the parameters that determine when location and heading events should be delivered and to start and stop the actual delivery of those events.


Methods name Desription
AuthorizationStatus The status of the location manager. When your application isn’t authorized to receive location you will receive an asAuthorizationStatusRestricted / asAuthorationStatusDenied value. When the value is asAuthorizationStatusNotDetermined your application needs to ask permissions before starting to monitor location and/or heading updates.
DismissHeadingCalibrationDisplay When monitoring heading updates the location manager might display a heading calibration window which can be dismissed with this method. The calibration window is only shown when True is returned in the OnShouldDisplayHeadingCalibration event.
Heading The last active heading managed by the location manager.
HeadingAvailable Verify if the location manager can monitor heading updates.
Location The last active location managed by the location manager.
LocationManager Returns a reference to the native CLLocationManager instance.
LocationServicesEnabled Verify if the location services are enabled before starting to monitor for location updates.
RequestAlwaysAuthorization When the AuthorizationStatus is not determined, request an “Always” authorization status for your application with this method. The OnDidChangeAuthorizationStatus is called when the status changes.
RequestWhenInUseAuthorization When the AuthorizationStatus is not determined, request a “When In Use” authorization status for your application with this method. The OnDidChangeAuthorizationStatus is called when the status changes.
SignificantLocationChangeMonitoringAvailable Verify if the location manager can monitor location updates, which will update after a significant difference is detected between the initial value and the value that is monitored.
StartMonitoringSignificantLocationChanges Start monitoring for location changes that are only retrieved when a significant difference is detected.
StartUpdatingHeading Start monitoring for heading updates.
StartUpdatingLocation Start monitoring for location changes.
StopMonitoringSignificantLocationChanges Stop monitoring for significant location changes.
StopUpdatingHeading Stop monitoring for heading updates.
StopUpdatingLocation Stop monitoring for location changes.


Properties name Description
ActivityType The type of activity that is executed for monitoring location and heading updates through the location manager.
DesiredAccuracy The accuracy of the location data in meters. If the value is -1, the location manager automatically determines the best accuracy for your device.
DistanceFilter The minimum distance (measured in meters) a device must move horizontally before an update event is generated.
HeadingOrientation The device orientation to use when computing heading values.
PausesLocationUpdatesAutomatically Property to configure automatic pausing and resuming of location changes.


Events name Description
OnDidChangeAuthorizationStatus Event called when the authorization status for your app changes.
OnDidFailWithError Event called when the location manager fails updating location/heading.
OnDidPauseLocationUpdates Event called automatically when the location manager has paused location update changes.
OnDidResumeLocationUpdates Event called automatically when the location manager has resumed location update changes.
OnDidUpdateHeading Event called when the heading changes.
OnDidUpdateLocations Event called when the location changes.
OnShouldDisplayHeadingCalibration Event that could be called if the device needs to calibrate the heading when monitored by your application.

Sample authorization and managing the location updates

The code below verifies if the location services are enabled and if your application is authorized to use location updates. The first time the application starts, the user will be prompted with an authorization dialog which asks permissions to use location updates. Afterwards, the method StartUpdatingLocation will be called and the annotation with the location of the device will be added to the map.

if TMSFMXNativeCLLocationManager1.LocationServicesEnabled then
  if TMSFMXNativeCLLocationManager1.AuthorizationStatus = asAuthorizationStatusNotDetermined then

procedure TForm1.StartLocationUpdates;
procedure TForm1.TMSFMXNativeCLLocationManager1DidChangeAuthorizationStatus(
  Sender: TObject;
  AAuthorizationStatus: TTMSFMXNativeCLLocationManagerAuthorizationStatus);
  if AAuthorizationStatus = asAuthorizationStatusAuthorizedAlways then

procedure TForm1.TMSFMXNativeCLLocationManager1DidUpdateLocations(
  Sender: TObject;
  ALocations: TArray<FMX.TMSNativeUICore.TTMSFMXNativeCLLocation>);
  ann: TTMSFMXNativeMKAnnotation;
  if Length(ALocations) > 0 then
    if TMSFMXNativeMKMapView1.Annotations.Count = 0 then
      ann := TMSFMXNativeMKMapView1.Annotations.Add
      ann := TMSFMXNativeMKMapView1.Annotations[0];

    ann.Location := MakeMapLocation(ALocations[0].Coordinate.Latitude, ALocations[0].Coordinate.Longitude);
    TMSFMXNativeMKMapView1.SetCenterLocation(ann.Location, True);