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 routeProposalSelector: RouteProposalSelector { get set } -
replan(navigationSnapshot:Asynchronousreason: routeReplanner: ) Replan a given
Routeusing async.Throws
TomTomSDKRouteReplanner.ReplanningErrorif cannot replan the route.Declaration
Swift
func replan( navigationSnapshot: NavigationSnapshot, reason: ReplanRequestReason, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner ) async throws -> RouteReplanningResultParameters
navigationSnapshotNavigationSnapshot, contains information about the state of the trip at a certain moment.
reasonReplanRequestReason, reason of route replanning
routeReplannerRouteReplanner, provides route replanning action for dynamic use cases
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: 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
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.
-
replan(navigationSnapshot:Extension methodreason: routeReplanner: completion: ) Replan a given
Routeusing completion handler.Throws
TomTomSDKRouteReplanner.ReplanningErrorif cannot replan the route.Declaration
Swift
public func replan( navigationSnapshot: NavigationSnapshot, reason: ReplanRequestReason, routeReplanner: TomTomSDKRouteReplanner.RouteReplanner, completion: @escaping (RouteReplanningResult) -> () ) throwsParameters
navigationSnapshotNavigationSnapshot, contains information about the state of the trip at a certain moment.
reasonReplanRequestReason, reason of route replanning
routeReplannerRouteReplanner, provides route replanning action for dynamic use cases
completionReturns RouteReplaningResult
TomTom SDK for iOS (0.53.1)
RouteReplanningEngine