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.

Lifecycle

Public

  • Provides access to current registered engines and allows updating them.

    Declaration

    Swift

    public var navigationEngineRegistry: NavigationEngineRegistry
  • The VehicleProvider used by the Navigation for providing vehicle updates to the navigation.

    Declaration

    Swift

    public let vehicleProvider: VehicleProvider
  • 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

    public 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

    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 to Navigation. 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 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

    public func removeNavigationObserver(_ observer: NavigationObserver)

    Parameters

    observer

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

  • Adds a NavigationStartObserver to Navigation. 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 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public 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

    public func removeArrivalObserver(_ observer: NavigationArrivalObserver)

    Parameters

    observer

    A class that can handle navigation arrival events.

  • Adds a NavigationHorizonObserver to Navigation. It is expected to be called on the main queue.

    Throws

    HorizonError.observerAlreadyRegistered if this NavigationHorizonObserver object is already registered for horizon updates. HorizonError.optionsAlreadyRegistered if these HorizonOptions 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 from Navigation. This method should be called on the deinit of the observer. It is expected to be called on the main queue.

    Throws

    HorizonError.observerNotRegistered if NavigationHorizonObserver wasn’t registered.

    Declaration

    Swift

    public func removeHorizonObserver(_ observer: NavigationHorizonObserver) throws

    Parameters

    observer

    A class that can handle navigation trip 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

    public 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

    public 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

    public 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

    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()
  • Manually marks the waypoint as visited. This action requires that the waypoint was previously announced as reached via NavigationArrivalObserver and that it has not been announced as visited via NavigationArrivalObserver. The navigation service marks the waypoint as visited, and NavigationArrivalObserver is notified.

    Throws

    NavigationProcessingError.nextWaypointError if calling requirements are not met.

    Declaration

    Swift

    public func markWaypointAsVisited(waypoint: RouteStop) throws

    Parameters

    waypoint

    The waypoint to mark as visited.

  • Stops the current navigation.

    Declaration

    Swift

    public func stop()