calculateTrafficOnRoute abstract method

TaskHandle calculateTrafficOnRoute(
  1. Route route,
  2. int lastTraveledSectionIndex,
  3. int traveledDistanceOnLastSectionInMeters,
  4. CalculateTrafficOnRouteCallback callback,
)

Asynchronously calculates the traffic along a route starting from the index of the last traveled route section and an offset (in meters) from the last visited position on the section.

Call this when only the contained traffic information or the latest ETA duration is needed. This can be called periodically to retrieve updated ETA values during navigation.

Note: Calling this method will trigger a new "HERE Traffic" transaction, for example, if you are using the Base Plan.

  • route A Route calculated using the online routing engine. Its RouteHandle and the original route calculation options will be used to compute the traffic on the route. The original route remains untouched.

  • lastTraveledSectionIndex Indicates the index of the last traveled route section. Traveled part of the route won't be reused.

  • traveledDistanceOnLastSectionInMeters Offset, in meters, to the last visited position on the route section defined by the last traveled section index.

  • callback Callback object that will be invoked after route traffic has been calculated. It is always invoked on the main thread.

Returns TaskHandle. Handle that will be used to manipulate the execution of the task.

Implementation

TaskHandle calculateTrafficOnRoute(Route route, int lastTraveledSectionIndex, int traveledDistanceOnLastSectionInMeters, CalculateTrafficOnRouteCallback callback);