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.
-
init(locationProvider:
dataSourceSelectionEngine: dataStoreMaintenanceEngine: mapMatchingEngine: routeProgressEngine: guidanceEngine: routeTrackingEngine: arrivalDetectionEngine: locationContextProviderEngine: horizonEngine: routeReplanner: routeReplanningEngine: routeProjectionEngine: routeReplanningRetryPolicy: routeDeviationReplanningRetryPolicy: 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( locationProvider: LocationProvider, dataSourceSelectionEngine: DataSourceSelectionEngine?, dataStoreMaintenanceEngine: DataStoreMaintenanceEngine?, mapMatchingEngine: MapMatchingEngine, routeProgressEngine: RouteProgressEngine, guidanceEngine: GuidanceEngine, routeTrackingEngine: RouteTrackingEngine?, arrivalDetectionEngine: ArrivalDetectionEngine, locationContextProviderEngine: LocationContextProviderEngine, horizonEngine: HorizonEngine?, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner, routeReplanningEngine: RouteReplanningEngine, routeProjectionEngine: RouteProjectionEngine?, routeReplanningRetryPolicy: ReplanningRetryPolicy, routeDeviationReplanningRetryPolicy: ReplanningRetryPolicy, betterProposalAcceptanceMode: BetterProposalAcceptanceMode, deviationReplanningMode: DeviationReplanningMode, vehicleProvider: VehicleProvider, usePredictions: Bool )
Parameters
locationProvider
The
LocationProvider
to be used during navigation.dataSourceSelectionEngine
The
DataSourceSelectionEngine
to be used during navigation.dataStoreMaintenanceEngine
The
DataStoreMaintenanceEngine
to be used during navigation.mapMatchingEngine
The
MapMatchingEngine
to be used during navigation.routeProgressEngine
The
RouteProgressEngine
to be used during navigation.guidanceEngine
The
GuidanceEngine
to be used during navigation.routeTrackingEngine
The
RouteTrackingEngine
to be used during navigation.arrivalDetectionEngine
The
ArrivalDetectionEngine
to be used during navigation.locationContextProviderEngine
The
LocationContextProviderEngine
to be used during navigation.horizonEngine
The
HorizonEngine
to be used during navigation.routeReplanner
The
TomTomSDKRouteReplanner.RouteReplanner
to be used during navigation.routeReplanningEngine
The
RouteReplanningEngine
to be used during navigation.routeProjectionEngine
The
RouteProjectionEngine
to be used during navigation.routeReplanningRetryPolicy
The
ReplanningRetryPolicy
to be used during navigation for replanning.routeDeviationReplanningRetryPolicy
The
ReplanningRetryPolicy
to be used during navigation for replanning on deviation.betterProposalAcceptanceMode
The
BetterProposalAcceptanceMode
to be used during navigation.deviationReplanningMode
The
DeviationReplanningMode
to be used during navigation.vehicleProvider
The
VehicleProvider
to be used during navigation.usePredictions
Use predictions during navigation.
-
init(locationProvider:
dataSourceSelectionEngine: dataStoreMaintenanceEngine: mapMatchingEngine: routeProgressEngine: guidanceEngine: routeTrackingEngine: arrivalDetectionEngine: locationContextProviderEngine: horizonEngine: routeReplanner: routeReplanningEngine: routeProjectionEngine: routeReplanningRetryPolicy: routeDeviationReplanningRetryPolicy: 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, locationContextProviderEngine: LocationContextProviderEngine, horizonEngine: HorizonEngine?, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner, routeReplanningEngine: RouteReplanningEngine, routeProjectionEngine: RouteProjectionEngine?, routeReplanningRetryPolicy: ReplanningRetryPolicy, routeDeviationReplanningRetryPolicy: ReplanningRetryPolicy, betterProposalAcceptanceMode: BetterProposalAcceptanceMode, deviationReplanningMode: DeviationReplanningMode, vehicleProvider: VehicleProvider )
Parameters
locationProvider
The
LocationProvider
to be used during navigation.dataSourceSelectionEngine
The
DataSourceSelectionEngine
to be used during navigation.dataStoreMaintenanceEngine
The
DataStoreMaintenanceEngine
to be used during navigation.mapMatchingEngine
The
MapMatchingEngine
to be used during navigation.routeProgressEngine
The
RouteProgressEngine
to be used during navigation.guidanceEngine
The
GuidanceEngine
to be used during navigation.routeTrackingEngine
The
RouteTrackingEngine
to be used during navigation.arrivalDetectionEngine
The
ArrivalDetectionEngine
to be used during navigation.locationContextProviderEngine
The
LocationContextProviderEngine
to be used during navigation.horizonEngine
The
HorizonEngine
to be used during navigation.routeReplanner
The
TomTomSDKRouteReplanner.RouteReplanner
to be used during navigation.routeReplanningEngine
The
RouteReplanningEngine
to be used during navigation.routeProjectionEngine
The
RouteProjectionEngine
to be used during navigation.routeReplanningRetryPolicy
The
ReplanningRetryPolicy
to be used during navigation for replanning.routeDeviationReplanningRetryPolicy
The
ReplanningRetryPolicy
to be used during navigation for replanning on deviation.betterProposalAcceptanceMode
The
BetterProposalAcceptanceMode
to be used during navigation.deviationReplanningMode
The
DeviationReplanningMode
to be used during navigation.vehicleProvider
The
VehicleProvider
to be used during navigation.
-
Provides access to current registered engines and allows updating them.
Declaration
Swift
public var navigationEngineRegistry: NavigationEngineRegistry
-
The
VehicleProvider
used by theDefaultTomTomNavigation
for providing vehicle updates to the navigation.Declaration
Swift
public let vehicleProvider: VehicleProvider
-
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 thenunitSystem
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 }
- for “USA” and “PRI” it will resolve to
-
The language used by Navigation SDK, stored as a Locale. Propagated to other components (e.g.
GuidanceEngine
) withNavigationSnapshot
.Note
Defaults to current system locale.Declaration
Swift
public var language: Locale { get set }
-
Provides a
CLLocation
for map matching.Declaration
Swift
public var mapMatchedLocationProvider: LocationProvider { get }
-
Provides a
CLLocation
for raw GPS position.Declaration
Swift
public var locationProvider: LocationProvider { get set }
-
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
toDefaultTomTomNavigation
. The call is expected 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
fromDefaultTomTomNavigation
. The call is expected 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
toDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func addStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationStartObserver
fromDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func removeStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Adds a
NavigationMapMatchingObserver
toDefaultTomTomNavigation
. The call is expected 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
fromDefaultTomTomNavigation
. The call is expected 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
toDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func addProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationProgressObserver
fromDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func removeProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation progress events.
-
Adds a
NavigationRouteObserver
toDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func addRouteObserver(_ observer: NavigationRouteObserver)
Parameters
observer
A class that can handle navigation route events.
-
Removes the
NavigationRouteObserver
fromDefaultTomTomNavigation
. The call is expected 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
. The call is expected on the main queue.Declaration
Swift
public func addGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Removes the
NavigationGuidanceObserver
fromDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Adds a
NavigationLocationContextObserver
toDefaultTomTomNavigation
. The call is expected 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
fromDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
A class that can handle navigation location context events.
-
Adds a
NavigationDestinationArrivalObserver
toDefaultTomTomNavigation
. 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 addDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Removes the
NavigationDestinationArrivalObserver
fromDefaultTomTomNavigation
. 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 removeDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Adds a
NavigationWaypointArrivalObserver
toDefaultTomTomNavigation
. 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 addWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Removes the
NavigationWaypointArrivalObserver
fromDefaultTomTomNavigation
. 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 removeWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
A class that can handle navigation arrival events.
-
Adds a
NavigationHorizonObserver
toDefaultTomTomNavigation
. The call is expected on the main queue.Throws
HorizonError.observerAlreadyRegistered
if thisNavigationHorizonObserver
object is already registered for horizon updates.HorizonError.optionsAlreadyRegistered
if theseHorizonOptions
are already being observed.Declaration
Swift
public func addHorizonObserver(_ observer: NavigationHorizonObserver, options: HorizonOptions) throws
Parameters
observer
A class that can handle navigation horizon events. To register a new observer with the same options, the previous one must be removed first. To register 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.
-
Removes the
NavigationHorizonObserver
fromDefaultTomTomNavigation
. This method should be called on the deinitialization of the observer. The call is expected on the main queue.Declaration
Swift
public func removeHorizonObserver(_ observer: NavigationHorizonObserver) throws
Parameters
observer
A class that can handle navigation trip events.
-
Adds a
NavigationRouteTrackingStateUpdateObserver
toDefaultTomTomNavigation
. 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 addRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
A class that can handle navigation follow the route events.
-
Removes the
NavigationRouteTrackingStateUpdateObserver
fromDefaultTomTomNavigation
. 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 removeRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
A class that can handle navigation follow the route events.
-
Adds a
NavigationErrorObserver
toDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func addErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.
-
Removes the
NavigationErrorObserver
fromDefaultTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
public func removeErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.
-
Starts navigation with the default routing.
Declaration
Swift
public func start()
-
Starts navigation with a navigation plan.
Declaration
Swift
public func start(navigationOptions: NavigationOptions)
Parameters
navigationOptions
NavigationOptions
to be used during the navigation session. -
Updates the route plan during ongoing navigation.
Declaration
Swift
public func update(navigationOptions: NavigationOptions)
Parameters
navigationOptions
NavigationOptions
to be used during the navigation session. -
Accept the better route proposed and update the route plan during navigation.
Declaration
Swift
public func acceptBetterProposal()
-
Marks a departure from the given waypoint independently from
ArrivalDetectionEngine/hasArrivedAtWaypoint
.The specified
waypoint
is marked as having been departed from andNavigationWaypointArrivalObserver
are notified about this viaNavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:)
. Notification viaNavigationDestinationArrivalObserver/didArriveAtWaypoint(waypoint:on:)
completes arrival detection for that particularwaypoint
. Navigation switches to arrival detection for the nextwaypoint
, 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
NavigationProcessingError/nextWaypointError
if calling requirements are not met.Declaration
Swift
public func departFromWaypoint(waypoint: RouteStop) throws
Parameters
waypoint
The waypoint to depart from.
- A
-
Stops the current navigation.
Declaration
Swift
public func stop()