TomTomRouteReplanningEngine

public final class TomTomRouteReplanningEngine : RouteReplanningEngine

RouteReplanningEngine implementation responsible for route replanning.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Initializer.

    Declaration

    Swift

    public convenience init()

Public

  • Selector responsible for choosing the best route from a refreshed route and it’s alternatives

    Declaration

    Swift

    public var routeProposalSelector: RouteProposalSelector
  • Declaration

    Swift

    public func replan(
        navigationSnapshot: NavigationSnapshot,
        reason: ReplanRequestReason,
        routeReplanner: TomTomSDKRouteReplanner.RouteReplanner
    ) async throws
        -> RouteReplanningResult
  • Checks if it is time to refresh the current route. This function might be called on every location update, so it is the engine’s responsibility to limit the replanning frequency.

    Declaration

    Swift

    public func shouldReplanRoute(_ route: inout Route, navigationSnapshot: NavigationSnapshot) -> Bool

    Parameters

    route

    A route that should be checked.

    navigationSnapshot

    Current navigation snapshot.

    Return Value

    A Boolean value indicating whether we should replan the route.

  • Checks if it is time to advance guidance progress of the current route. This function might be called on every location update, so it is the engine’s responsibility to limit the replanning frequency.

    Declaration

    Swift

    public func shouldAdvanceGuidanceProgress(_ route: Route) -> Bool

    Parameters

    route

    A route that should be checked.

    Return Value

    A Boolean value that indicates whether the guidance progress should be advanced.