OfflineRoutePlanner
public final class OfflineRoutePlanner : RoutePlanner
Offline planner that plans a route from an origin to a destination, passing through waypoints (if specified).
This function calculates route contents (instructions, lane guidance) within its certain part using the provided
RouteIncrementOptions
object.
Note
Route ETA should be updated outside advanceGuidanceProgress
call
Note
It’s currently expected that only following Route contents will be updated: Route.legs(i).instructions Route.laneSections
Important
This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public func advanceGuidanceProgress(with options: RouteIncrementOptions) -> Result<Route, Error>
Parameters
options
|
Return Value
If the call succeeds, return a Route
. If it fails, return an Error
.
Cancels all current planning requests.
Declaration
Swift
public func cancelPendingRequests()
Defines the error cases that can occur while planning a trip.
See moreDeclaration
Swift
@available(*, deprecated, renamed: "TomTomSDKRoutingCommon.RoutingError", message: "This API is deprecated and will be removed with the next major release.")
public enum PlanError : Error
Plans a route according to the parameters set in the RoutePlanningOptions.
Declaration
Swift
public func planRoute(
options: TomTomSDKRoutingCommon.RoutePlanningOptions,
onRouteReady: ((Route) -> ())?,
completion: @escaping (Result<RoutePlanningResponse, Error>) -> ()
)
Parameters
options
|
|
onRouteReady
|
Closure executed whenever a route is done planning |
completion
|
Closure called when planning is done (successfully or with an error) |