NavigationService
@objc(MBNavigationService)
public protocol NavigationService : CLLocationManagerDelegate, DefaultInterfaceFlag, EventsManagerDataSource, RouterDataSource
A NavigationService
is the entry-point protocol for MapboxCoreNavigation.
It contains all the dependencies needed by the MapboxNavigation
UI SDK, as well as dependencies for its child objects.
MapboxNavigationService
is the default implementation.
If you would like to implement your own core-navigation stack, be sure to conform to this protocol.
-
The location manager for the service. This will be the object responsible for notifying the service of GPS updates.
Declaration
Swift
var locationManager: NavigationLocationManager { get }
-
A reference to a MapboxDirections service. Used for rerouting.
Declaration
Swift
var directions: Directions { get }
-
The active router, responsible for all route-following.
Declaration
Swift
var router: Router! { get }
-
The events manager, responsible for all telemetry.
Declaration
Swift
var eventsManager: NavigationEventsManager! { get }
-
The route along which the user is expected to travel.
Declaration
Swift
var route: Route { get set }
-
The simulation mode of the service.
Declaration
Swift
var simulationMode: SimulationMode { get set }
-
The simulation speed-multiplier. Modify this if you desire accelerated simulation.
Declaration
Swift
var simulationSpeedMultiplier: Double { get set }
-
The Amount of time the service will wait until it begins simulation in a poor GPS scenerio. Defaults to 2.5 seconds.
Declaration
Swift
var poorGPSPatience: Double { get set }
-
The
NavigationService
delegate. WrapsRouterDelegate
messages.Declaration
Swift
weak var delegate: NavigationServiceDelegate? { get set }
-
Starts the navigation service.
Declaration
Swift
func start()
-
Stops the navigation service. You may call
start()
after callingstop()
.Declaration
Swift
func stop()
-
Ends the navigation session. Used when arriving at destination.
Declaration
Swift
func endNavigation(feedback: EndOfRouteFeedback?)
-
Interrogates the navigationService as to whether or not the passed-in location is in a tunnel.
Declaration
Swift
func isInTunnel(at location: CLLocation, along progress: RouteProgress) -> Bool