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 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?
-
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?
-
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)
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.
-
Convienence factory-method for convenient bridging to Objective-C.
Declaration
Swift
public class func navigationOptions() -> Self