NavigationSettings
public class NavigationSettings
Global settings that are used across the SDK for altering navigation behavior.
Some properties listed in StoredProperty
are stored in UserDefaults.standard
.
To specify criteria when calculating routes, use the NavigationRouteOptions
class.
To customize the user experience during a particular turn-by-turn navigation session, use the NavigationOptions
class
when initializing a NavigationViewController
.
To customize some global defaults use NavigationSettings.initialize(directions:tileStoreConfiguration:)
method.
-
Default
Directions
instance. By default,Directions.shared
is used.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:)
method.Declaration
Swift
public var directions: Directions { get }
-
Global
TileStoreConfiguration
instance.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:)
method.Declaration
Swift
public var tileStoreConfiguration: TileStoreConfiguration { get }
-
Initializes the settings with custom instances of globally used types.
If you don’t provide custom values, they will be initialized with the defaults.
Important
If you want to use this method, it should be the first method you use from Navigation SDK. Not doing so will lead to undefined behavior.
Declaration
Swift
public func initialize(directions: Directions, tileStoreConfiguration: TileStoreConfiguration)
Parameters
directions
Default
Directions
instance. Some types allow you to customize the directions instance and fall back to theNavigationSettings.directions
by default.tileStoreConfiguration
Options for configuring how map and navigation tiles are stored on the device. See
TileStoreConfiguration
for more details. -
The volume that the voice controller will use.
This volume is relative to the system’s volume where 1.0 is same volume as the system.
Declaration
Swift
public dynamic var voiceVolume: Float { get set }
-
Specifies whether to mute the voice controller or not.
Declaration
Swift
public dynamic var voiceMuted: Bool { get set }
-
Specifies the preferred distance measurement unit. Meters and feet will be used when the presented distances are small enough. See
DistanceFormatter
for more information.Declaration
Swift
public dynamic var distanceUnit: LengthFormatter.Unit { get set }
-
The shared navigation settings object that affects the entire application.
Declaration
Swift
public static let shared: NavigationSettings