TomTomNavigation
public protocol TomTomNavigation : AnyObject
The TomTomNavigation
protocol defines the functionality of the navigation.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Provides access to current registered engines and allows updating them.
Declaration
Swift
var navigationEngineRegistry: NavigationEngineRegistry { get set }
-
The
VehicleProvider
used by theTomTomNavigation
for providing vehicle updates to the navigation.Declaration
Swift
var vehicleProvider: VehicleProvider { get }
-
Provides a
CLLocation
for map matching.Declaration
Swift
var mapMatchedLocationProvider: LocationProvider { get }
-
Provides a
CLLocation
for raw GPS position.Declaration
Swift
var locationProvider: LocationProvider { get set }
-
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
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
var language: Locale { get set }
-
A publishable variable that can be used to receive the same events that the delegate presents
Declaration
Swift
var eventPublisher: AnyPublisher<NavigationEvent, Never> { get }
-
Starts navigation with the default routing.
Declaration
Swift
func start()
-
Starts navigation with a navigation plan.
Declaration
Swift
func start(navigationOptions: NavigationOptions)
Parameters
navigationOptions
NavigationOptions
to be used during the navigation session. -
Updates the route plan during ongoing navigation.
Declaration
Swift
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
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
func departFromWaypoint(waypoint: RouteStop) throws
Parameters
waypoint
The waypoint to depart from.
- A
-
Stops the current navigation.
Declaration
Swift
func stop()
-
Adds a
NavigationObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addNavigationObserver(_ observer: NavigationObserver)
Parameters
observer
A class that can handle all navigation events except for error events.
-
Removes the
NavigationObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeNavigationObserver(_ observer: NavigationObserver)
Parameters
observer
A class that can handle all navigation events except for error events.
-
Adds a
NavigationStartObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationStartObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeStartObserver(_ observer: NavigationStartObserver)
Parameters
observer
A class that can handle navigation start events.
-
Adds a
NavigationMapMatchingObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addMapMatchingObserver(_ observer: NavigationMapMatchingObserver)
Parameters
observer
A class that can handle navigation map matching events.
-
Removes the
NavigationMapMatchingObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeMapMatchingObserver(_ observer: NavigationMapMatchingObserver)
Parameters
observer
A class that can handle navigation map matching events.
-
Adds a
NavigationProgressObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation start events.
-
Removes the
NavigationProgressObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeProgressObserver(_ observer: NavigationProgressObserver)
Parameters
observer
A class that can handle navigation progress events.
-
Adds a
NavigationRouteObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addRouteObserver(_ observer: NavigationRouteObserver)
Parameters
observer
A class that can handle navigation route events.
-
Removes the
NavigationRouteObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
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
func addGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Removes the
NavigationGuidanceObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)
Parameters
observer
A class that can handle navigation guidance events.
-
Adds a
NavigationLocationContextObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
A class that can handle navigation location context events.
-
Removes the
NavigationLocationContextObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)
Parameters
observer
A class that can handle navigation location context events.
-
Adds a
NavigationDestinationArrivalObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
A class that can handle navigation destination arrival events.
-
Removes the
NavigationDestinationArrivalObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeDestinationArrivalObserver(_ observer: NavigationDestinationArrivalObserver)
Parameters
observer
A class that can handle navigation destination arrival events.
-
Adds a
NavigationWaypointArrivalObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
A class that can handle navigation waypoint arrival events.
-
Removes the
NavigationWaypointArrivalObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeWaypointArrivalObserver(_ observer: NavigationWaypointArrivalObserver)
Parameters
observer
A class that can handle navigation waypoint arrival events.
-
Adds a
NavigationHorizonObserver
toTomTomNavigation
. 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
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
fromTomTomNavigation
. This method should be called on the deinitialization of the observer. The call is expected on the main queue.Declaration
Swift
func removeHorizonObserver(_ observer: NavigationHorizonObserver) throws
Parameters
observer
A class that can handle navigation trip events.
-
Adds a
NavigationRouteTrackingStateUpdateObserver
toTomTomNavigation
. 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
func addRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
A class that can handle navigation follow the route events.
-
Removes the
NavigationRouteTrackingStateUpdateObserver
fromTomTomNavigation
. 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
func removeRouteTrackingStateUpdateObserver(_ observer: NavigationRouteTrackingStateUpdateObserver)
Parameters
observer
A class that can handle navigation follow the route events.
-
Adds a
NavigationErrorObserver
toTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func addErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.
-
Removes the
NavigationErrorObserver
fromTomTomNavigation
. The call is expected on the main queue.Declaration
Swift
func removeErrorObserver(_ observer: NavigationErrorObserver)
Parameters
observer
A class that can handle navigation error events.