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

    InstantiationError Indicates what went wrong when the instantiation was attempted.

    Declaration

    Swift

    public init() throws
  • Creates a new instance of TransitRoutingEngine.

    Throws

    InstantiationError Indicates what went wrong when the instantiation was attempted.

    Declaration

    Swift

    public init(_ sdkEngine: SDKNativeEngine) throws

    Parameters

    sdkEngine

    An 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) -> TaskHandle

    Parameters

    startingPoint

    Position of starting point.

    destination

    Position of destination.

    routeOptions

    Options for public transit route calculation.

    completion

    Callback 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.