NavigationOptions
open class NavigationOptions : NavigationCustomizable
Customization options for the turn-by-turn navigation user experience in a NavigationViewController.
A navigation options object is where you place customized components that the navigation view controller uses during its lifetime, such as styles or voice controllers. You would likely use this class if you need to specify a Mapbox access token programmatically instead of in the Info.plist file.
Note
NavigationOptions is designed to be used with the NavigationViewController class to customize the user experience. To specify criteria when calculating routes, use the NavigationRouteOptions class. To modify user preferences that persist across navigation sessions, use the NavigationSettings class.
-
The styles that the view controller’s internal
StyleManagerobject can select from for display.If this property is set to
nil, aDayStyleand aNightStyleare created to be used as the view controller’s styles. This property is set tonilby default.Declaration
Swift
open var styles: [Style]? -
The view controller to embed into the top section of the UI.
If this property is set to
nil, aTopBannerViewControlleris created and embedded in the UI. This property is set tonilby default.Declaration
Swift
open var topBanner: ContainerViewController? -
The view controller to embed into the bottom section of the UI.
If this property is set to
nil, aBottomBannerViewControlleris created and embedded in the UI. This property is set tonilby default.Declaration
Swift
open var bottomBanner: ContainerViewController? -
Custom
NavigationMapViewinstance to be embedded in navigation UI.If set to
nil, a defaultNavigationMapViewinstance will be created. When a custom instance is set,NavigationViewwill update its delegate and camera’sviewportDatasourceto function correctly. You may want to use this property for customization or optimization purposes.Declaration
Swift
open var navigationMapView: NavigationMapView?
-
The navigation service that manages navigation along the route.
Declaration
Swift
open var navigationService: NavigationService? -
The voice controller that manages the delivery of voice instructions during navigation.
Declaration
Swift
open var voiceController: RouteVoiceController? -
Configuration for predictive caching.
These options control how the
PredictiveCacheManagerwill try to proactively fetch data related to the route. Anilvalue disables the feature.Declaration
Swift
open var predictiveCacheOptions: PredictiveCacheOptions? -
The simulation mode type. Used for setting the simulation mode of the navigation service.
If set to
nilwill default to.inTunnels. This setting will be ignored if customnavigationServiceinstance was provided.Declaration
Swift
open var simulationMode: SimulationMode? -
init(styles:navigationService:voiceController:topBanner:bottomBanner:predictiveCacheOptions:navigationMapView:simulationMode:)Initializes an object that configures a
NavigationViewController.Declaration
Swift
public convenience init(styles: [Style]? = nil, navigationService: NavigationService? = nil, voiceController: RouteVoiceController? = nil, topBanner: ContainerViewController? = nil, bottomBanner: ContainerViewController? = nil, predictiveCacheOptions: PredictiveCacheOptions? = nil, navigationMapView: NavigationMapView? = nil, simulationMode: SimulationMode? = nil)Parameters
stylesThe user interface styles that are available for display.
navigationServiceThe navigation service that coordinates the view controller’s nonvisual components, tracking the user’s location as they proceed along the route.
voiceControllerThe voice controller that vocalizes spoken instructions along the route at the appropriate times.
topBannerThe container view controller that presents the top banner.
bottomBannerThe container view controller that presents the bottom banner.
predictiveCacheOptionsConfiguration for predictive caching. These options control how the
PredictiveCacheManagerwill try to proactively fetch data related to the route. Anilvalue disables the feature.navigationMapViewCustom
NavigationMapViewinstance to supersede the default one. -
Convienence factory-method for convenient bridging to Objective-C.
Declaration
Swift
public class func navigationOptions() -> Self
Install in Dash
NavigationOptions Class Reference