StandaloneRouteProgressEngine

public final class StandaloneRouteProgressEngine : RouteProgressEngine

Responsible for calculating route progress in a standalone manner.

The purpose is to calculate and provide updates on the progress of the navigated route based on NavigationSnapshot.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Initializes an instance of StandaloneRouteProgressEngine.

    Declaration

    Swift

    public convenience init()
  • Calculates the progress for each route in the navigation snapshot.

    This method takes a navigationSnapshot and calculates the progress for each route within it. It returns a dictionary mapping route IDs to their respective RouteProgress.

    Throws

    An error if progress calculation fails.

    Declaration

    Swift

    public func calculateProgress(navigationSnapshot: NavigationSnapshot) throws -> [UUID : RouteProgress]

    Parameters

    navigationSnapshot

    The snapshot of the current navigation state.

    Return Value

    A dictionary mapping route IDs to their respective RouteProgress.

  • Resets the state of the StandaloneRouteProgressEngine.

    Declaration

    Swift

    public func reset()