DefaultTomTomNavigation
@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.")
public class DefaultTomTomNavigation : TomTomNavigation
The DefaultTomTomNavigation object defines the functionality of the navigation.
Important
DefaultTomTomNavigation isn’t thread-safe and it’s recommended to make API calls always on the same thread.Adds a NavigationActiveRouteChangeObserver
to Navigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addActiveRouteChangeObserver(_ observer: NavigationActiveRouteChangeObserver)
Parameters
observer
|
A class that can handle navigation active route changed events. |
Adds a NavigationDestinationArrivalObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
|
A class that can handle navigation arrival events. |
Adds a NavigationGuidanceObserver
to Navigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Adds a GuidanceUpdateObserver
to TomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Adds a NavigationHorizonObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Throws
HorizonError.observerAlreadyRegistered
if this NavigationHorizonObserver
object is already added for horizon updates.
HorizonError.optionsAlreadyRegistered
if these HorizonOptions
are already being observed.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addHorizonObserver(_ observer: NavigationHorizonObserver, options: HorizonOptions) throws
Parameters
observer
|
A class that can handle navigation horizon events. To add a new observer with the same options, the previous one must be removed first. To add different options with the same observer, the previous one must be removed first. |
options
|
The options that define the extent of the paths on the horizon and which map attributes to collect. |
Adds a LaneGuidanceUpdateObserver
to TomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Adds a NavigationLanguageChangeObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func addLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)
Parameters
observer
|
A class that can handle navigation language change events. |
Adds a NavigationLocationContextObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
|
A class that can handle navigation location context events. |
Adds a LocationMapMatchingObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addLocationMapMatchingObserver(_ observer: LocationMapMatchingObserver)
Parameters
observer
|
A class that can handle navigation map matching events. |
Adds a NavigationStateChangeObserver
to DefaultTomTomNavigation
.
The observer is notified of changes to the navigationState
.
The call is expected on the main queue. The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addNavigationStateChangeObserver(_ observer: NavigationStateChangeObserver)
Parameters
observer
|
A class that can handle navigation state changes. |
Adds a NavigationProgressObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
|
A class that can handle navigation start events. |
Adds a NavigationRouteAddObserver
to Navigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addRouteAddObserver(_ observer: NavigationRouteAddObserver)
Parameters
observer
|
A class that can handle navigation route added events. |
Adds a NavigationRouteRemoveObserver
to Navigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addRouteRemoveObserver(_ observer: NavigationRouteRemoveObserver)
Parameters
observer
|
A class that can handle navigation route removed events. |
Adds a TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Declaration
Swift
public func addRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
|
A class that can handle navigation follow the route events. |
Adds a NavigationRouteUpdateObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)
Parameters
observer
|
A class that can handle navigation route updated events. |
Adds a NavigationWaypointArrivalObserver
to DefaultTomTomNavigation
.
The call is expected on the main queue.
The system keeps a weak reference to the observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func addWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
|
A class that can handle navigation arrival events. |
The current BetterProposalAcceptanceMode
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var betterProposalAcceptanceMode: TomTomSDKNavigationEngines.BetterProposalAcceptanceMode { get set }
Marks a departure from the given waypoint independently
from ArrivalDetectionEngine/hasArrivedAtWaypoint
.
The specified waypoint
is marked as having been departed from
and NavigationWaypointArrivalObserver
are notified about
this via NavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:)
.
Notification via NavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:)
completes arrival detection
for that particular waypoint
.
Navigation switches to arrival detection for the next waypoint
, if one is present.
Prerequisites for this action:
- A
didArriveAtWaypoint(waypoint:on:)
notification was previously issued for thiswaypoint
. No
didDepartFromWaypoint(waypoint:on:)
notification was previously issued for thiswaypoint
.
Throws
nextWaypointError
if calling requirements are not met.
Declaration
Swift
public func departFromWaypoint(waypoint: RouteStop) throws
Parameters
waypoint
|
The waypoint to depart from. |
Controls how the route deviations are handled.
When set to TomTomSDKNavigationEngines/DeviationReplanningMode/automatic
the navigation replans the route automatically.
When set to TomTomSDKNavigationEngines/DeviationReplanningMode/none
the navigation does not replan the route.
The default value is TomTomSDKNavigationEngines/DeviationReplanningMode/automatic
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var deviationReplanningMode: DeviationReplanningMode { get set }
A publishable variable that can be used to receive the same events that the delegate presents
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var eventPublisher: AnyPublisher<NavigationEvent, Never> { get }
Errors that are thrown when removing/adding horizon observer.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum HorizonError : Error
init(locationProvider:dataSourceSelectionEngine:dataStoreMaintenanceEngine:mapMatchingEngine:routeProgressEngine:guidanceEngine:routeTrackingEngine:arrivalDetectionEngine:horizonEngine:routeReplanner:routeReplanningEngine:routeReplanningRetryPolicy:betterProposalAcceptanceMode:deviationReplanningMode:vehicleProvider:)
Creates an instance of DefaultTomTomNavigation
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public convenience init(
locationProvider: LocationProvider,
dataSourceSelectionEngine: DataSourceSelectionEngine?,
dataStoreMaintenanceEngine: DataStoreMaintenanceEngine?,
mapMatchingEngine: MapMatchingEngine,
routeProgressEngine: RouteProgressEngine,
guidanceEngine: GuidanceEngine,
routeTrackingEngine: RouteTrackingEngine?,
arrivalDetectionEngine: ArrivalDetectionEngine,
horizonEngine: HorizonEngine?,
routeReplanner: TomTomSDKRouteReplanner.RouteReplanner,
routeReplanningEngine: RouteReplanningEngine,
routeReplanningRetryPolicy: ReplanningRetryPolicy,
betterProposalAcceptanceMode: BetterProposalAcceptanceMode,
deviationReplanningMode: DeviationReplanningMode,
vehicleProvider: VehicleProvider
)
Parameters
locationProvider
|
The |
dataSourceSelectionEngine
|
The |
dataStoreMaintenanceEngine
|
The |
mapMatchingEngine
|
The |
routeProgressEngine
|
The |
guidanceEngine
|
The |
routeTrackingEngine
|
The |
arrivalDetectionEngine
|
The |
horizonEngine
|
The |
routeReplanner
|
The |
routeReplanningEngine
|
The |
routeReplanningRetryPolicy
|
The |
betterProposalAcceptanceMode
|
The |
deviationReplanningMode
|
The |
vehicleProvider
|
The |
init(locationProvider:dataSourceSelectionEngine:dataStoreMaintenanceEngine:mapMatchingEngine:routeProgressEngine:guidanceEngine:routeTrackingEngine:arrivalDetectionEngine:horizonEngine:routeReplanner:routeReplanningEngine:routeReplanningRetryPolicy:betterProposalAcceptanceMode:deviationReplanningMode:vehicleProvider:usePredictions:)
Creates an instance of DefaultTomTomNavigation
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init( // swiftlint:disable:this function_body_length
locationProvider: LocationProvider,
dataSourceSelectionEngine: DataSourceSelectionEngine?,
dataStoreMaintenanceEngine: DataStoreMaintenanceEngine?,
mapMatchingEngine: MapMatchingEngine,
routeProgressEngine: RouteProgressEngine,
guidanceEngine: GuidanceEngine,
routeTrackingEngine: RouteTrackingEngine?,
arrivalDetectionEngine: ArrivalDetectionEngine,
horizonEngine: HorizonEngine?,
routeReplanner: TomTomSDKRouteReplanner.RouteReplanner,
routeReplanningEngine: RouteReplanningEngine,
routeReplanningRetryPolicy: ReplanningRetryPolicy,
betterProposalAcceptanceMode: BetterProposalAcceptanceMode,
deviationReplanningMode: DeviationReplanningMode,
vehicleProvider: VehicleProvider,
usePredictions: Bool
)
Parameters
locationProvider
|
The |
dataSourceSelectionEngine
|
The |
dataStoreMaintenanceEngine
|
The |
mapMatchingEngine
|
The |
routeProgressEngine
|
The |
guidanceEngine
|
The |
routeTrackingEngine
|
The |
arrivalDetectionEngine
|
The |
horizonEngine
|
The |
routeReplanner
|
The |
routeReplanningEngine
|
The |
routeReplanningRetryPolicy
|
The |
betterProposalAcceptanceMode
|
The |
deviationReplanningMode
|
The |
vehicleProvider
|
The |
usePredictions
|
Use predictions during navigation. |
The current language used within TomTomNavigation
in guidance instructions and announcement language.
The initial value is Locale.current
.
To change language
, see preferredLanguage
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var language: Locale { get }
Provides a CLLocation
for raw GPS position.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var locationProvider: LocationProvider { get set }
Provides a CLLocation
for map matching.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var mapMatchedLocationProvider: LocationProvider { get }
Provides access to currently added engines and allows updating them.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var navigationEngineRegistry: NavigationEngineRegistry
The current TomTomSDKNavigationEngines/NavigationSnapshot
.
navigationSnapshot
is nil
at the start of navigation in the following situations:
- If the location provider is disabled.
- If the location provider is enabled but unable to find the location.
Note
OncenavigationSnapshot
is defined, it remains defined throughout the navigation session.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var navigationSnapshot: NavigationSnapshot? { get }
The current NavigationState
within DefaultTomTomNavigation
.
The initial value is set to idle
.
To change DefaultTomTomNavigation/navigationState
, see
start()
,
start(navigationOptions:)
,
stop()
and
setActiveRoutePlan(_:)
.
To observe changes to DefaultTomTomNavigation/navigationState
see NavigationStateChangeObserver
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var navigationState: NavigationState { get }
The preferred language to be used within TomTomNavigation
in guidance instructions and announcement language.
The initial value is Locale.current
.
If the initial language is not supported, en-US
will be used instead.
Supported languages can be acquired from GuidanceEngine.availableLanguages
.
Setting the preferred language updates the route.
You can check the updated route language using language
.
If the specified language is not supported, en-US
will be used instead.
To observe language changes, add:
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var preferredLanguage: Locale { get set }
Removes the NavigationActiveRouteChangeObserver
from Navigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeActiveRouteChangeObserver(_ observer: NavigationActiveRouteChangeObserver)
Parameters
observer
|
A class that can handle navigation active route changed events. |
Removes the NavigationDestinationArrivalObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
|
A class that can handle navigation arrival events. |
Removes the NavigationGuidanceObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Removes the GuidanceUpdateObserver
from TomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeGuidanceUpdateObserver(_ observer: GuidanceUpdateObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Removes the NavigationHorizonObserver
from DefaultTomTomNavigation
.
This method should be called on the deinitialization of the observer.
The call is expected on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeHorizonObserver(_ observer: NavigationHorizonObserver) throws
Parameters
observer
|
A class that can handle navigation trip events. |
Removes a LaneGuidanceUpdateObserver
from TomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeLaneGuidanceUpdateObserver(_ observer: LaneGuidanceUpdateObserver)
Parameters
observer
|
A class that can handle navigation guidance events. |
Removes the NavigationLanguageChangeObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func removeLanguageChangeObserver(_ observer: NavigationLanguageChangeObserver)
Parameters
observer
|
A class that can report on changes to the navigation language. |
Removes the NavigationLocationContextObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
|
A class that can handle navigation location context events. |
Removes the LocationMapMatchingObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeLocationMapMatchingObserver(_ observer: LocationMapMatchingObserver)
Parameters
observer
|
A class that can handle navigation map matching events. |
Removes the NavigationStateChangeObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeNavigationStateChangeObserver(_ observer: NavigationStateChangeObserver)
Parameters
observer
|
A class that can handle navigation state changes. |
Removes the NavigationProgressObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
|
A class that can handle navigation progress events. |
Removes the NavigationRouteAddObserver
from Navigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeRouteAddObserver(_ observer: NavigationRouteAddObserver)
Parameters
observer
|
A class that can handle navigation route added events. |
Removes the NavigationRouteRemoveObserver
from Navigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeRouteRemoveObserver(_ observer: NavigationRouteRemoveObserver)
Parameters
observer
|
A class that can handle navigation route removed events. |
Removes the TomTomSDKNavigation/NavigationRouteTrackingStateUpdateObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Declaration
Swift
public func removeRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
|
A class that can handle navigation follow the route events. |
Removes the NavigationRouteUpdateObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed, the system will clean up when the next event is posted. The call is expected on the main queue. Do not call this method from the deinitializer of the observer, unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeRouteUpdateObserver(_ observer: NavigationRouteUpdateObserver)
Parameters
observer
|
A class that can handle navigation route updated events. |
Removes the NavigationWaypointArrivalObserver
from DefaultTomTomNavigation
.
There is no need to remove the observer. If the observer is not removed,
the system will clean up when the next event is posted.
The call is expected on the main queue. Do not call this method from the deinitializer of the observer,
unless you are certain that the observer will be destroyed on the main queue.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func removeWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
|
A class that can handle navigation arrival events. |
Selects the Route
with provided routeID
as active.
The navigation switches to navigate along the desired route and the following listeners are notified:
didChangeActiveRoute(route:)
withRoute
selected byrouteID
.didRemoveRoute(route:reason:)
with the previously activeRoute
andmanual
If theRoute
corresponding to the givenrouteId
is not available, changing does not occur.
Declaration
Swift
public func selectActiveRoute(routeId: UUID)
Parameters
routeId
|
|
Updates the route plan during ongoing navigation.
The following listeners are notified:
NavigationRouteUpdateObserver/didUpdateRoute(route:options:reason:)
with the updatedRoute
,RoutePlanniningOptions
andRouteUpdatedReason/manuallyUpdated
if current route does not contain the providedrouteId
, the method does not update the route.didChangeActiveRoute(route:)
with theRoute
if active route has changed.didRemoveRoute(route:reason:)
with all other routes except the activeRoute
andmanual
.
Throws
An error if RoutePlan
is incompatible with navigation configuration.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func setActiveRoutePlan(_ routePlan: RoutePlan) throws
Starts navigation without specifying a TomTomSDKRoute/Route
.
Use this method to start the navigation in free driving mode.
Navigation goes through the following steps:
- Providing the
TomTomSDKNavigationEngines/MapMatchingResult
viaLocationMapMatchingObserver
. - Providing the updated
TomTomSDKNavigationEngines/LocationContext
viaNavigationLocationContextObserver
. - Providing the updated
TomTomSDKNavigationEngines/HorizonSnapshot
viaNavigationHorizonObserver
.
As a result of successful action, the following observer is notified:
NavigationStateChangeObserver
, with the state set tofreeDriving
.
Throws
An error if navigation has already started.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func start() throws
Starts navigation with the provided NavigationOptions
.
Use this method to start the navigation in active guidance mode with the provided TomTomSDKRoute/Route
within the NavigationOptions
.
Navigation goes through the following steps:
- Providing the
TomTomSDKNavigationEngines/MapMatchingResult
viaLocationMapMatchingObserver
. - Providing the updated
TomTomSDKNavigationEngines/LocationContext
viaNavigationLocationContextObserver
. - Providing the updated
TomTomSDKNavigationEngines/HorizonSnapshot
viaNavigationHorizonObserver
.
Additionally, the system performs the following operations for the active, i.e., currently
navigated TomTomSDKRoute/Route
within the NavigationOptions
:
- Calculating
TomTomSDKNavigationEngines/RouteProgress
and updating viaNavigationProgressObserver
. - Checking all followed routes and deviations via
NavigationRouteTrackingStateUpdateObserver
. - Generating
TomTomSDKNavigationEngines/Guidance
viaGuidanceUpdateObserver
. - Detecting arrival, possibly calling
NavigationDestinationArrivalObserver
orNavigationWaypointArrivalObserver
.
As a result of successful action, the following observer is notified:
NavigationStateChangeObserver
, with the state set toactiveGuidance
.NavigationRouteAddObserver
, with theTomTomSDKRoute/Route
andTomTomSDKRoutePlanner/RoutePlanningOptions
set inactiveRoutePlan
, andnavigationStarted
.NavigationActiveRouteChangeObserver
, with theTomTomSDKRoute/Route
set inactiveRoutePlan
.
Throws
An error if navigation has already started or if NavigationOptions
are incompatible with navigation configuration.
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func start(navigationOptions: NavigationOptions) throws
Parameters
navigationOptions
|
Details of the navigation options for starting the navigation session.
|
Stops current navigation session and clears data related to it.
If start has not been called previously, this method has no effect.
As a result of successful action, the following observer is notified:
NavigationStateChangeObserver
, with the state set toidle
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func stop()
The unit system to be used within TomTomNavigation
.
Once set, it is propagated to other components (e.g. GuidanceEngine
) and
used for the generation of guidance announcements.
If the UnitSystemType
instance is dynamic then unitSystem
is resolved based on the country attribute of the current location:
- for “USA” and “PRI” it will resolve to
SpecificUnitSystem/imperialFeet
. - for “GBR” it will resolve to
SpecificUnitSystem/imperialYards
. - for other countries it will resolve to
SpecificUnitSystem/metric
.
The default value is UnitSystemType.default
.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var unitSystem: UnitSystemType { get set }
The VehicleProvider
used by the DefaultTomTomNavigation
for providing vehicle updates to the navigation.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public let vehicleProvider: VehicleProvider