RouteController
@objc(MBRouteController)
open class RouteController : NSObject
A RouteController
tracks the user’s progress along a route, posting notifications as the user reaches significant points along the route. On every location update, the route controller evaluates the user’s location, determining whether the user remains on the route. If not, the route controller calculates a new route.
RouteController
is responsible for the core navigation logic whereas
NavigationViewController
is responsible for displaying a default drop-in navigation UI.
-
Details about the user’s progress along the current route, leg, and step.
Declaration
Swift
@objc public var routeProgress: RouteProgress { get set }
-
The route controller’s delegate.
Declaration
Swift
@objc public weak var delegate: RouterDelegate?
-
The route controller’s associated location manager.
Declaration
Swift
@objc public unowned var dataSource: RouterDataSource
-
The Directions object used to create the route.
Declaration
Swift
@objc public var directions: Directions
-
The idealized user location. Snapped to the route line, if applicable, otherwise raw.
See also
snappedLocation, rawLocationDeclaration
Swift
@objc public var location: CLLocation? { get }
-
Declaration
Swift
required public init(along route: Route, directions: Directions = Directions.shared, dataSource source: RouterDataSource)
-
Declaration
Swift
public func advanceLegIndex(location: CLLocation)
-
Declaration
Swift
public func userIsOnRoute(_ location: CLLocation) -> Bool