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 }
  • Refreshes a given Route when it needs to be refreshed

    Declaration

    Swift

    func replanToRefresh(
        parameters: RouteReplanParameters,
        completion: @escaping (RouteReplanningResult) -> ()
    ) throws

    Parameters

    parameters

    Parameters for a route replan.

    completion

    Completion block with a result of refresh operation.

  • Plans a new Route when the user has deviated from the previous.

    Declaration

    Swift

    func replanOnDeviation(
        parameters: RouteReplanParameters,
        completion: @escaping (RouteReplanningResult) -> ()
    ) throws

    Parameters

    parameters

    Parameters for a route replan.

    completion

    Completion block with a result of refresh operation.

  • 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() -> Bool