NavigationViewController
public class NavigationViewController: NavigationPulleyViewController, RouteMapViewControllerDelegate
NavigationViewController is fully featured, turn by turn navigation UI.
It provides step by step instructions, an overview of all steps for the given route and support for basic styling.
-
A
Routeobject constructed by MapboxDirections.In cases where you need to update the route after navigation has started you can set a new
routehere andNavigationViewControllerwill update its UI accordingly.Declaration
Swift
public var route: Route! -
An instance of
MGLAnnotationthat will be shown on on the destination of your route. The last coordinate of the route will be used if no destination is given.Declaration
Swift
public var destination: MGLAnnotation! -
An instance of
Directionsneed for rerouting. See Mapbox Directions for further information.Declaration
Swift
public var directions: Directions! -
An optional
MGLMapCamerayou can use to improve the initial transition from a previous viewport and prevent a trigger from an excessive significant location update.Declaration
Swift
public var pendingCamera: MGLMapCamera? -
An instance of
MGLAnnotationrepresenting the origin of your route.Declaration
Swift
public var origin: MGLAnnotation? -
The receiver’s delegate.
Declaration
Swift
public weak var navigationDelegate: NavigationViewControllerDelegate? -
Provides access to various speech synthesizer options.
See
RouteVoiceControllerfor more information.Declaration
Swift
public var voiceController: RouteVoiceController? = RouteVoiceController() -
Provides all routing logic for the user.
See
RouteControllerfor more information.Declaration
Swift
public var routeController: RouteController! -
Styles that will be used for various system traits.
See
StyleandDefaultStylefor more information.Declaration
Swift
public var styles: [Style] = [DefaultStyle()] -
Provides access to the navigation’s
MGLMapViewwith all its styling capabilities.Note that you should not change the
mapView‘s delegate.Declaration
Swift
public var mapView: MGLMapView? -
Toggles sending of UILocalNotification upon upcoming steps when application is in the background. Defaults to
true.Declaration
Swift
public var sendNotifications: Bool = true -
Declaration
Swift
required public init?(coder aDecoder: NSCoder)Parameters
aDecoder -
Declaration
Swift
required public init(contentViewController: UIViewController, drawerViewController: UIViewController)Parameters
contentViewControllerdrawerViewController -
Initializes a
NavigationViewControllerthat provides turn by turn navigation for the given route. A optionaldirectionobject is needed for potential rerouting.See Mapbox Directions for further information.
Declaration
Swift
required public init(for route: Route, directions: Directions = Directions.shared, styles: [Style]? = [DefaultStyle()], locationManager: NavigationLocationManager? = DefaultLocationManager())
-
Declaration
Swift
public func routeController(_ routeController: RouteController, shouldRerouteFrom location: CLLocation) -> BoolParameters
routeControllerlocation -
Declaration
Swift
public func routeController(_ routeController: RouteController, willRerouteFrom location: CLLocation)Parameters
routeControllerlocation -
Declaration
Swift
public func routeController(_ routeController: RouteController, didRerouteAlong route: Route)Parameters
routeControllerroute -
Declaration
Swift
public func routeController(_ routeController: RouteController, didFailToRerouteWith error: Error)Parameters
routeControllererror -
Declaration
Swift
public func routeController(_ routeController: RouteController, didUpdateLocations locations: [CLLocation])Parameters
routeControllerlocations
Install in Dash
NavigationViewController Class Reference