MapboxNavigationService

public class MapboxNavigationService : NSObject, NavigationService
extension MapboxNavigationService: CLLocationManagerDelegate
extension MapboxNavigationService: RouterDelegate
extension MapboxNavigationService: ReplayManagerHistoryEventsListener

A concrete implementation of the NavigationService protocol.

NavigationViewController comes with a MapboxNavigationService by default. You may override it to customize the Directions service or simulation mode. After creating the navigation service, pass it into NavigationOptions(styles:navigationService:voiceController:topBanner:bottomBanner:), then pass that object into NavigationViewController(for:options:).

If you use a navigation service by itself, outside of NavigationViewController, call start() when the user is ready to begin navigating along the route.

  • The active location manager. Returns the location simulator if we’re actively simulating, otherwise it returns the native location manager.

    Declaration

    Swift

    public var locationManager: NavigationLocationManager { get }
  • A reference to a MapboxDirections service. Used for rerouting.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `routingProvider` instead. If navigation service was not initialized using `Directions` object - this property is unused and ignored.")
    public lazy var directions: Directions { get set }
  • Custom RoutingProvider, used to create a route during refreshing or rerouting.

    Declaration

    Swift

    @available(*, deprecated, message: "Use `customRoutingProvider` instead. This property will be equal to `customRoutingProvider` if that is provided or a `MapboxRoutingProvider` instance otherwise.")
    public var routingProvider: RoutingProvider { get }
  • Custom RoutingProvider, used to create a route during refreshing or rerouting.

    If set to nil - default Mapbox implementation will be used.

    Declaration

    Swift

    public var customRoutingProvider: RoutingProvider? { get }
  • Credentials data, used to authorize server requests.

    Declaration

    Swift

    public var credentials: Credentials