NavigationLocationProvider
open class NavigationLocationProvider : NSObject, LocationProvider, CLLocationManagerDelegate
An object that notifies a map view when the user’s location changes, minimizing the noise that normally accompanies location updates from a CLLocationManager
object.
If your application displays a MapView
before starting turn-by-turn navigation, call LocationManager.overrideLocationProvider(with:)
to override default location provider so that the map view always shows the location snapped to the road network. For example, use this class to show the user’s current location as they wander around town.
This class depends on NavigationLocationManager
to detect the user’s location as it changes.
-
The location provider’s location manager, which detects the user’s location as it changes.
Declaration
Swift
public var locationManager: NavigationLocationManager
-
Configuration for the
locationManager
.Declaration
Swift
public var locationProviderOptions: LocationOptions { get set }
-
Starts the generation of location updates that report the device’s current location.
Declaration
Swift
public func startUpdatingLocation()
-
Stops the generation of location updates.
Declaration
Swift
public func stopUpdatingLocation()
-
The location provider’s delegate.
Declaration
Swift
public weak var delegate: LocationProviderDelegate?
-
Declaration
Swift
public func setDelegate(_ delegate: LocationProviderDelegate)
-
The most recently reported heading.
Declaration
Swift
public var heading: CLHeading? { get }
-
Specifies a physical device orientation.
Declaration
Swift
public var headingOrientation: CLDeviceOrientation { get set }
-
Starts the generation of heading updates that reports the devices’s current heading.
Declaration
Swift
public func startUpdatingHeading()
-
Stops the generation of heading updates.
Declaration
Swift
public func stopUpdatingHeading()
-
Dismisses immediately the heading calibration view from the screen.
Declaration
Swift
public func dismissHeadingCalibrationDisplay()
-
Initializes the location provider with the given location manager.
Declaration
Swift
public init(locationManager: NavigationLocationManager)
Parameters
locationManager
A location manager that detects the user’s location as it changes.
-
Returns the current localization authorization status.
Declaration
Swift
public var authorizationStatus: CLAuthorizationStatus { get }
-
Sends the locations update through the delegate to the
MapView
after overriding thelocationProvider
ofMapView
.Declaration
Swift
public func didUpdateLocations(locations: [CLLocation])
-
Returns the current accuracy authorization that the user has granted
Declaration
Swift
public var accuracyAuthorization: CLAccuracyAuthorization { get }
-
Requests permission to use the location services whenever the app is running.
Declaration
Swift
public func requestAlwaysAuthorization()
-
Requests permission to use the location services while the app is in the foreground.
Declaration
Swift
public func requestWhenInUseAuthorization()
-
Requests temporary permission for precise accuracy
Declaration
Swift
@available(iOS 14.0, *) public func requestTemporaryFullAccuracyAuthorization(withPurposeKey purposeKey: String)