Navigation
public class Navigation : EngineActions
The Navigation object defines the functionality of the navigation.
Important
This is a Public Preview API. It may be changed or removed at any time.-
The unit system used by the SDK.
Propagated to other components (e.g.
GuidanceEngine
) withNavigationSnapshot
.If the
UnitSystemType
instance is dynamic, then unit system is resolved based on current location country:- “USA” and “PRI” -
SpecificUnitSystem/imperialFeet
. - “GBR” -
SpecificUnitSystem/imperialYards
. - Other countries -
SpecificUnitSystem/metric
.
Declaration
Swift
public var unitSystem: UnitSystemType { get set }
- “USA” and “PRI” -
-
A publishable variable that can be used to receive the same events that the delegate presents
Declaration
Swift
public var eventPublisher: AnyPublisher<NavigationEvent, Never> { get }
-
Adds a
NavigationObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addNavigationObserver(_ observer: NavigationObserver)
Parameters
observer
A class that can handle all navigation events except for error events.
-
Removes the
NavigationObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeNavigationObserver(_ observer: NavigationObserver)
Parameters
observer
A class that can handle all navigation events except for error events.
-
Adds a
NavigationStartObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationStartObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Adds a
NavigationMapMatchingObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addMapMatchingObserver(_ observer: NavigationMapMatchingObserver)
Parameters
observer
A class that can handle navigation map matching events.
-
Removes the
NavigationMapMatchingObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeMapMatchingObserver(_ observer: NavigationMapMatchingObserver)
Parameters
observer
A class that can handle navigation map matching events.
-
Adds a
NavigationProgressObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationProgressObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation progress events.
-
Adds a
NavigationRouteObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addRouteObserver(_ observer: NavigationRouteObserver)
Parameters
observer
A class that can handle navigation route events.
-
Removes the
NavigationRouteObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeRouteObserver(_ observer: NavigationRouteObserver)
Parameters
observer
A class that can handle navigation route events.
-
Adds a
NavigationGuidanceObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Removes the
NavigationGuidanceObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Adds a
NavigationLocationContextObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
A class that can handle navigation location context events.
-
Removes the
NavigationLocationContextObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
A class that can handle navigation location context events.
-
Adds a
NavigationArrivalObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addArrivalObserver(_ observer: NavigationArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Removes the
NavigationArrivalObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeArrivalObserver(_ observer: NavigationArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Adds a
NavigationHorizonObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Warning
This is an experimental API. It may be changed or removed at any time without notice. Use of this API is strongly discouraged.Declaration
Swift
public func addHorizonObserver(_ observer: NavigationHorizonObserver)
Parameters
observer
A class that can handle navigation horizon events.
-
Removes the
NavigationHorizonObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Warning
This is an experimental API. It may be changed or removed at any time without notice. Use of this API is strongly discouraged.Declaration
Swift
public func removeHorizonObserver(_ observer: NavigationHorizonObserver)
Parameters
observer
A class that can handle navigation trip events.
-
Adds a
NavigationErrorObserver
toNavigation
. Keeps a weak pointer to the observer. It is expected to be called on the main queue.Declaration
Swift
public func addErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.
-
Removes the
NavigationErrorObserver
fromNavigation
. There is no need to call this function from the deinit of the observer. It is expected to be called on the main queue.Declaration
Swift
public func removeErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.
-
Declaration
Swift
public func start()
-
Declaration
Swift
public func start(navigationOptions: NavigationOptions)
-
Declaration
Swift
public func update(routePlan: RoutePlan)
-
Declaration
Swift
public func stop()
-
Declaration
Swift
public func navigationSnapshot() -> NavigationSnapshot?
-
Important
This is a Public Preview API. It may be changed or removed at any time. The mode of navigation after start.Declaration
Swift
public enum NavigationMode
-
OptionsError contains information about any problems that occur during navigation . The detailed meaning of each error is provided via the
message
variable.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum OptionsError : Error