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
StyleManager
object can select from for display.If this property is set to
nil
, aDayStyle
and aNightStyle
are created to be used as the view controller’s styles. This property is set tonil
by 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
, aTopBannerViewController
is created and embedded in the UI. This property is set tonil
by 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
, aBottomBannerViewController
is created and embedded in the UI. This property is set tonil
by default.Declaration
Swift
open var bottomBanner: ContainerViewController?
-
Custom
NavigationMapView
instance to be embedded in navigation UI.If set to
nil
, a defaultNavigationMapView
instance will be created. When a custom instance is set,NavigationView
will update its delegate and camera’sviewportDatasource
to 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
PredictiveCacheManager
will try to proactively fetch data related to the route. Anil
value 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
nil
will default to.inTunnels
. This setting will be ignored if customnavigationService
instance 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
styles
The user interface styles that are available for display.
navigationService
The navigation service that coordinates the view controller’s nonvisual components, tracking the user’s location as they proceed along the route.
voiceController
The voice controller that vocalizes spoken instructions along the route at the appropriate times.
topBanner
The container view controller that presents the top banner.
bottomBanner
The container view controller that presents the bottom banner.
predictiveCacheOptions
Configuration for predictive caching. These options control how the
PredictiveCacheManager
will try to proactively fetch data related to the route. Anil
value disables the feature.navigationMapView
Custom
NavigationMapView
instance to supersede the default one. -
Convienence factory-method for convenient bridging to Objective-C.
Declaration
Swift
public class func navigationOptions() -> Self