Skip to main content

My Location

Handling standard iOS location permissions and engaging native user tracking.

Important iOS requirement

To use the location tracking features, your app must define usage descriptions in Info.plist:

  1. Add the key Privacy - Location When In Use Usage Description and provide a reason string.
  2. Add the key Privacy - Location Always and When In Use Usage Description and provide a reason string.

Request location and enable tracking​

func requestLocation() {
if locationManager.authorizationStatus == .notDetermined {
locationManager.requestWhenInUseAuthorization()
}
rawMapView?.showsUserLocation = true
rawMapView?.userTrackingMode = .followWithHeading
}

See also: iOS Map SDK overview.