HybridRouteReplanner

public final class HybridRouteReplanner : RouteReplanner

The hybrid implementation for the RouteReplanner.

Important

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

Lifecycle

  • Initializer.

    Declaration

    Swift

    public convenience init(
        onlineRoutePlanner: OnlineRoutePlanner,
        offlineRoutePlanner: OfflineRoutePlanner
    )

    Parameters

    onlineRoutePlanner

    Instance of the streamed navigation-tiles route planner.

    offlineRoutePlanner

    Instance of the offline map route planner.

Public

  • The async awaits implementation. This method gets called when the route needs to be refreshed.

    Declaration

    Swift

    public func update(_ options: RouteUpdateOptions) -> AsyncThrowingStream<Route, Error>

    Parameters

    options

    Options used to get a route update.

    Return Value

    an AsyncThrowingStream of Routes.

  • The async awaits implementation. This method gets called each time there’s a deviation of the route.

    Declaration

    Swift

    public func backToRoute(_ options: BackToRouteOptions) -> AsyncThrowingStream<Route, Error>

    Parameters

    options

    Options used to get a route update.

    Return Value

    an AsyncThrowingStream of Routes.

  • Add more guidance instructions to the route if it doesn’t have enough of them. May result in RouteReplanningReason increment.

    Throws

    An error if async task is canceled.

    Declaration

    Swift

    public func advanceGuidanceProgress(_ options: RouteIncrementOptions) async throws -> Route

    Parameters

    options

    Parameters for a route replan.

    Return Value

    A Route updated with the next instructions.