RouteReplanningEngine

public protocol RouteReplanningEngine

Engine responsible for replanning a route.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Selector responsible for choosing the best route from a refreshed route and it’s alternatives

    Declaration

    Swift

    var betterRouteSelector: BetterRouteSelector { get set }
  • replan(parameters:) Asynchronous

    Replan a given Route using async

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Use replan(navigationSnapshot:reason:routeReplanner:﹚ async throws -> RouteReplanningResult instead")
    func replan(
        parameters: RouteReplanParameters
    ) async throws -> RouteReplanningResult

    Return Value

    RouteReplaningResult

  • Replan a given Route using async

    • navigationSnapshot: NavigationSnapshot, contains information about the state of the trip at a certain moment.
    • reason: ReplanRequestReason, reason of route replanning
    • routeReplanner: RouteReplanner, provides route replanning action for dynamic use cases

    Declaration

    Swift

    func replan(
        navigationSnapshot: NavigationSnapshot,
        reason: ReplanRequestReason,
        routeReplanner: TomTomSDKRouteReplanner.RouteReplanner
    ) async throws -> RouteReplanningResult

    Return Value

    RouteReplaningResult

  • 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

    func shouldReplanRoute(_ route: Route) -> Bool

    Return Value

    A boolean value that indicates should we replan the route or not

RouteReplanningEngine

  • Replan a given Route using completion handler

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Use replan(navigationSnapshot:reason:routeReplanner:﹚ async throws -> RouteReplanningResult instead")
    public func replan(
        parameters: RouteReplanParameters,
        completion: @escaping (RouteReplanningResult) -> ()
    ) throws

    Return Value

    RouteReplaningResult

  • Replan a given Route using completion handler

    • navigationSnapshot: NavigationSnapshot, contains information about the state of the trip at a certain moment.
    • reason: ReplanRequestReason, reason of route replanning
    • routeReplanner: RouteReplanner, provides route replanning action for dynamic use cases

    Declaration

    Swift

    public func replan(
        navigationSnapshot: NavigationSnapshot,
        reason: ReplanRequestReason,
        routeReplanner: TomTomSDKRouteReplanner.RouteReplanner,
        completion: @escaping (RouteReplanningResult) -> ()
    ) throws

    Return Value

    RouteReplaningResult