TomTomRouteReplanningEngine
public final class TomTomRouteReplanningEngine : RouteReplanningEngine
RouteReplanningEngine implementation.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates a
TomTomRouteReplanningEngineinstance with default options.Declaration
Swift
public convenience init() -
Creates a
TomTomRouteReplanningEngineinstance with the specified options.Declaration
Swift
public convenience init(options: RouteReplanningEngineOptions)Parameters
optionsThe options to configure the route replanning engine.
-
Initializes a new instance of
TomTomRouteReplanningEngine.Declaration
Swift
public init( options: RouteReplanningEngineOptions, routeProposalSelector: RouteProposalSelector )Parameters
optionsThe options to configure the route replanning engine.
routeProposalSelectorThe selector responsible for choosing the best route.
-
Selector responsible for choosing the best route from a refreshed route and its alternatives
Declaration
Swift
public var routeProposalSelector: RouteProposalSelector -
replan(navigationSnapshot:Asynchronousreason: routeReplanner: ) Replans the route based on the given navigation snapshot and reason.
Throws
An error if the replanning fails.Declaration
Swift
public func replan( navigationSnapshot: NavigationSnapshot, reason: ReplanRequestReason, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner ) async throws -> RouteReplanningResultParameters
navigationSnapshotThe current navigation snapshot.
reasonThe reason for the replan request.
routeReplannerThe route replanner to use for replanning.
Return Value
A
RouteReplanningResultcontaining the result of the replanning. -
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) -> BoolParameters
routeA route that should be checked.
navigationSnapshotCurrent 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) -> BoolParameters
routeA route that should be checked.
Return Value
A Boolean value that indicates whether the guidance progress should be advanced.
TomTom SDK for iOS (0.66.0)
TomTomRouteReplanningEngine