TomTomNavigation

public protocol TomTomNavigation

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 the TomTomNavigation 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 used by the SDK.

    Propagated to other components (e.g., GuidanceEngine) with NavigationSnapshot.

    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

    var unitSystem: UnitSystemType { get set }
  • The language used by Navigation SDK, stored as a Locale. Propagated to other components (e.g. GuidanceEngine) with NavigationSnapshot.

    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 }
  • start() Default implementation

    Starts navigation with the default routing.

    Default Implementation

    Starts navigation with the default routing.

    Declaration

    Swift

    func start()
  • start(navigationOptions:) Default implementation

    Starts navigation with a navigation plan.

    Warning

    NavigationOptions.alternativeRoutePlans is not used as multi-route navigation is not supported.

    Default Implementation

    Starts navigation with a navigation plan.

    Warning

    NavigationOptions.alternativeRoutePlans is not used as multi-route navigation is not supported.

    Declaration

    Swift

    func start(navigationOptions: NavigationOptions)

    Parameters

    navigationOptions

    NavigationOptions to be used during navigation session.

  • update(navigationOptions:) Default implementation

    Updates the route plan during ongoing navigation.

    Default Implementation

    Updates the route plan during ongoing navigation.

    • navigationOptions: NavigationOptions to be used during a navigation session.

    Declaration

    Swift

    func update(navigationOptions: NavigationOptions)
  • Accept the better route proposed and update the route plan during navigation.

    Declaration

    Swift

    func acceptBetterProposal()
  • Manually marks the waypoint as visited. This action requires that waypoint was previously announced as reached via NavigationArrivalObserver and that it has not been announced as visited via NavigationArrivalObserver. Throws NavigationProcessingError.nextWaypointError if calling requirements are not met. The navigation service marks the waypoint as visited, and NavigationArrivalObserver is notified.

    • waypoint: The waypoint to mark as visited.

    Declaration

    Swift

    func markWaypointAsVisited(waypoint: RouteStop) throws
  • Stops the current navigation.

    Declaration

    Swift

    func stop()
  • Adds a NavigationObserver to TomTomNavigation. Keeps a weak pointer to the observer. It is expected to be called 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 from TomTomNavigation. 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

    func removeNavigationObserver(_ observer: NavigationObserver)

    Parameters

    observer

    A class that can handle all navigation events except for error events.

  • Adds a NavigationStartObserver to TomTomNavigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addStartObserver(_ observer: NavigationStartObserver)

    Parameters

    observer

    A class that can handle navigation start events.

  • Removes the NavigationStartObserver from Navigation. 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

    func removeStartObserver(_ observer: NavigationStartObserver)

    Parameters

    observer

    A class that can handle navigation start events.

  • Adds a NavigationMapMatchingObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addMapMatchingObserver(_ observer: NavigationMapMatchingObserver)

    Parameters

    observer

    A class that can handle navigation map matching events.

  • Removes the NavigationMapMatchingObserver from Navigation. 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

    func removeMapMatchingObserver(_ observer: NavigationMapMatchingObserver)

    Parameters

    observer

    A class that can handle navigation map matching events.

  • Adds a NavigationProgressObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addProgressObserver(_ observer: NavigationProgressObserver)

    Parameters

    observer

    A class that can handle navigation start events.

  • Removes the NavigationProgressObserver from Navigation. 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

    func removeProgressObserver(_ observer: NavigationProgressObserver)

    Parameters

    observer

    A class that can handle navigation progress events.

  • Adds a NavigationRouteObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addRouteObserver(_ observer: NavigationRouteObserver)

    Parameters

    observer

    A class that can handle navigation route events.

  • Removes the NavigationRouteObserver from Navigation. 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

    func removeRouteObserver(_ observer: NavigationRouteObserver)

    Parameters

    observer

    A class that can handle navigation route events.

  • Adds a NavigationGuidanceObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addGuidanceObserver(_ observer: NavigationGuidanceObserver)

    Parameters

    observer

    A class that can handle navigation guidance events.

  • Removes the NavigationGuidanceObserver from Navigation. 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

    func removeGuidanceObserver(_ observer: NavigationGuidanceObserver)

    Parameters

    observer

    A class that can handle navigation guidance events.

  • Adds a NavigationLocationContextObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addLocationContextObserver(_ observer: NavigationLocationContextObserver)

    Parameters

    observer

    A class that can handle navigation location context events.

  • Removes the NavigationLocationContextObserver from Navigation. 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

    func removeLocationContextObserver(_ observer: NavigationLocationContextObserver)

    Parameters

    observer

    A class that can handle navigation location context events.

  • Adds a NavigationArrivalObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addArrivalObserver(_ observer: NavigationArrivalObserver)

    Parameters

    observer

    A class that can handle navigation arrival events.

  • Removes the NavigationArrivalObserver from Navigation. 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

    func removeArrivalObserver(_ observer: NavigationArrivalObserver)

    Parameters

    observer

    A class that can handle navigation arrival events.

  • Adds a NavigationRouteTrackingStateUpdateObserver to Navigation. Keeps a weak pointer to the observer. It is expected to be called 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 from Navigation. There is no need to call this function from the deinit of the observer. It is expected to be called 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 to Navigation. Keeps a weak pointer to the observer. It is expected to be called on the main queue.

    Declaration

    Swift

    func addErrorObserver(_ observer: NavigationErrorObserver)

    Parameters

    observer

    A class that can handle navigation error events.

  • Removes the NavigationErrorObserver from Navigation. 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

    func removeErrorObserver(_ observer: NavigationErrorObserver)

    Parameters

    observer

    A class that can handle navigation error events.