calculateTrafficOnRoute method - RoutingEngine class - routing library - Dart API
calculateTrafficOnRoute abstract method
- Route route,
- int lastTraveledSectionIndex,
- int traveledDistanceOnLastSectionInMeters,
- 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.
-
routeA 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. -
lastTraveledSectionIndexIndicates the index of the last traveled route section. Traveled part of the route won't be reused. -
traveledDistanceOnLastSectionInMetersOffset, in meters, to the last visited position on the route section defined by the last traveled section index. -
callbackCallback 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);