TransitRoutingEngine
public class TransitRoutingEngine
extension TransitRoutingEngine: NativeBase
extension TransitRoutingEngine: Hashable
Use the TransitRoutingEngine to calculate a public transit route from A to B with a number of waypoints in between. Route calculation is done asynchronously and requires an online connection. The resulting route contains various information such as the polyline, route length in meters, estimated time to traverse along the route and maneuver data.
-
Creates a new instance of this class.
Throws
InstantiationErrorIndicates what went wrong when the instantiation was attempted.Declaration
Swift
public init() throws -
Creates a new instance of TransitRoutingEngine.
Throws
InstantiationErrorIndicates what went wrong when the instantiation was attempted.Declaration
Swift
public init(_ sdkEngine: SDKNativeEngine) throwsParameters
sdkEngineAn SDKEngine instance.
-
Asynchronously calculates a public transit route from the origin to the destination.
Declaration
Swift
@discardableResult public func calculateRoute(startingPoint: TransitWaypoint, destination: TransitWaypoint, routeOptions: TransitRouteOptions, completion: @escaping CalculateRouteCompletionHandler) -> TaskHandleParameters
startingPointPosition of starting point.
destinationPosition of destination.
routeOptionsOptions for public transit route calculation.
completionCallback object that will be invoked after route calculation. It is always invoked on the main thread.
Return Value
Handle that will be used to manipulate the execution of the task.