Class TransitRoutingEngine
Class TransitRoutingEngine
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.routing.TransitRoutingEngine
-
public final class TransitRoutingEngine extends NativeBase
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.
Note: Clients need to explicitly call
dispose()in order to prevent a possible, though unlikely, deadlock on destruction.
-
-
Constructor Summary
Constructors Constructor Description TransitRoutingEngine()Creates a new instance of this class.TransitRoutingEngine(SDKNativeEngine sdkEngine)Creates a new instance of TransitRoutingEngine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskHandlecalculateRoute(TransitWaypoint startingPoint, TransitWaypoint destination, TransitRouteOptions routeOptions, CalculateRouteCallback callback)Asynchronously calculates a public transit route from the origin to the destination.voiddispose()Cancels pending requests and closes the background worker thread.
-
-
-
Constructor Detail
-
TransitRoutingEngine
public TransitRoutingEngine() throws InstantiationErrorExceptionCreates a new instance of this class.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
TransitRoutingEngine
public TransitRoutingEngine(@NonNull SDKNativeEngine sdkEngine) throws InstantiationErrorExceptionCreates a new instance of TransitRoutingEngine.
- Parameters:
sdkEngine-An SDKEngine instance.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
-
Method Detail
-
calculateRoute
@NonNull public TaskHandle calculateRoute(@NonNull TransitWaypoint startingPoint, @NonNull TransitWaypoint destination, @NonNull TransitRouteOptions routeOptions, @NonNull CalculateRouteCallback callback)
Asynchronously calculates a public transit route from the origin to the destination.
- Parameters:
startingPoint-Position of starting point.
destination-Position of destination.
routeOptions-Options for public transit route calculation.
callback-Callback object that will be invoked after route calculation. It is always invoked on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
dispose
public void dispose()
Cancels pending requests and closes the background worker thread. Note: This method should be called from main thread.
-
-