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 Details

  • Method Details

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