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:routingProviderSource:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.
-
Default
Directions
instance. By default,Directions.shared
is used.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.Declaration
Swift
public var directions: Directions { get }
-
Global
TileStoreConfiguration
instance.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.Declaration
Swift
public var tileStoreConfiguration: TileStoreConfiguration { get }
-
You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.Declaration
Swift
public var routingProviderSource: RoutingProviderSource { get }
-
Configuration on how
AlternativeRoute
s will be detected during navigation process.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.If set to
nil
, the detection is turned off.Declaration
Swift
public var alternativeRouteDetectionStrategy: AlternativeRouteDetectionStrategy? { get }
-
Enables analyzing data from sensors for better location prediction in case of a weak GPS signal, for example in tunnel.
Usage of sensors can increase battery consumption. Disabled by default.
Important
Don’t enable sensors if you emulate location updates. The SDK ignores location updates which don’t match data from sensors.Declaration
Swift
public var utilizeSensorData: Bool { get }
-
Defines approximate navigator prediction between location ticks.
Due to discrete location updates, Navigator always operates data “in the past” so it has to make prediction about user’s current real position. This interval controls how far ahead Navigator will try to predict user location.
If not specified (
nilled
), default value will be used.You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.Declaration
Swift
public var navigatorPredictionInterval: TimeInterval? { get }
-
Configuration on how live incidents on a most probable path are detected.
You can override this property by using
NavigationSettings.initialize(directions:tileStoreConfiguration:navigationRouterType:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
method.If set to
nil
, live incidents are turned off (by default).Declaration
Swift
public var liveIncidentsOptions: IncidentsOptions? { get }
-
initialize(directions:tileStoreConfiguration:routingProviderSource:alternativeRouteDetectionStrategy:utilizeSensorData:navigatorPredictionInterval:liveIncidentsOptions:)
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, routingProviderSource: RoutingProviderSource = .hybrid, alternativeRouteDetectionStrategy: AlternativeRouteDetectionStrategy? = .init(), utilizeSensorData: Bool = false, navigatorPredictionInterval: TimeInterval? = nil, liveIncidentsOptions: IncidentsOptions? = nil)
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.routingProviderSource
Configures the type of routing to be used by various SDK objects when providing route calculations. Use this value to configure usage of onlive vs. offline data for routing.
alternativeRouteDetectionStrategy
Configures how
AlternativeRoute
s will be detected during navigation process.utilizeSensorData
Enables using sensors data to improve positioning.
navigatorPredictionInterval
Defines approximate navigator prediction between location ticks.
liveIncidentsOptions
Configures Electronic Horizon live incidents.
-
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