Free-driving mode

Free-driving mode is a unique Mapbox Navigation SDK feature that allows drivers to navigate without a set destination. This mode is sometimes referred to as passive navigation.

When to use free-driving mode

The Navigation SDK’s free-driving mode snaps the device’s location to the road network using map matching and predicts location updates to prevent visual lags and disruptions in areas with poor GPS coverage (including tunnels). Unlike in turn-by-turn navigation, you do not provide a route and the user does not need to stick to a predefined path.

This allows you to keep the map in your application continually centered on the device’s current location and proactively provide drivers with relevant information about nearby places and roads including traffic, incidents, and points of interest. For example, free-driving mode would be helpful to drivers who are in areas they are familiar with and do not need turn-by-turn instructions, but may want to avoid congested roads.

Implement free-driving mode

To enable free-driving mode in a MapView, create a PassiveLocationManager override default LocationProvider with custom one by calling MapView.Location.overrideLocationProvider(with:) method.

To receive these locations without an MapView, use the PassiveLocationManagerDelegate class and implement the PassiveLocationManagerDelegate.passiveLocationManager(_:didUpdateLocation:rawLocation:) method or observe passiveLocationManagerDidUpdate notifications.

Further resources