PassiveLocationManager

open class PassiveLocationManager : NSObject
extension PassiveLocationManager: PassiveNavigationEventsManagerDataSource
extension PassiveLocationManager: HistoryRecording
extension PassiveLocationManager: CLLocationManagerDelegate

An object that notifies its delegate when the user’s location changes, minimizing the noise that normally accompanies location updates from a CLLocationManager object.

Unlike Router classes such as RouteController and LegacyRouteController, this class operates without a predefined route, matching the user’s location to the road network at large. You can use a passive location manager to determine a starting point for a route that you calculate using the Directions.calculate(_:completionHandler:) method. If the user happens to be moving while you calculate the route, the passive location manager makes it less likely that the route will begin with a short segment on a side road or driveway and a confusing instruction to turn onto the current road.

To find out when the user’s location changes, implement the PassiveLocationManagerDelegate protocol, or observe Notification.Name.passiveLocationManagerDidUpdate notifications for more detailed information.

Important

Creating an instance of this class will start a free-driving session. If the application goes into the background or you temporarily stop needing location updates for any other reason, temporarily pause the trip session using the PassiveLocationManager.pauseTripSession() method to avoid unnecessary costs. The trip session also stops when the instance is deinitialized. For more information, see the “Pricing” guide.