refreshRouteWithTraveledDistanceAndRoutingOptions abstract method
- RouteHandle routeHandle,
- Waypoint? startingPoint,
- int? lastTraveledSectionIndex,
- int? traveledDistanceOnLastSectionInMeters,
- RoutingOptions options,
- CalculateRouteCallback callback,
Asynchronously refreshes a previously calculated route from the provided RouteHandle, updating the starting point and route metadata based on RoutingOptions.
The route shape from the new starting point to the destination remains unchanged, and only metadata such as arrival time and traffic delays are updated. If you only want to refresh the contained traffic information, consider to use RoutingEngine.calculateTrafficOnRouteWithCurrentCharge instead.
Calling this method will trigger a new "HERE Routing" transaction, for example, if you are using the Base Plan.
-
routeHandleThe route handle holding the route to be refreshed. -
startingPointUpdates the starting point of the route. It should be of type WaypointType.stopover. Otherwise, an RoutingError.invalidParameter error is generated. Moreover, it should be very close to the original route specified with the RouteHandle. Since the new starting point is expected to be along the original route, the original route geometry is used to reach the remaining waypoints. The new route will not include the Waypoint items that lie behind the new starting point (i.e. the path that was already traveled). Plus, Route.lengthInMeters and Route.duration values are from the new starting point to the destination. If the new waypoint is too far off the original route, the route refresh may fail and an RoutingError.couldNotMatchOrigin error is triggered. In that case, an application may decide to calculate a new route from scratch. -
lastTraveledSectionIndexIndicates the index of the last traveled route section. Traveled part of the route won't be reused. -
traveledDistanceOnLastSectionInMetersOffset in meter to the last visited position on the route section defined by the last traveled section index. -
optionsThe options define the vehicle and route options to calculate the route. -
callbackCallback object that will be invoked after refreshing the route. It is always invoked on the main thread.
Returns TaskHandle. Handle that will be used to manipulate the execution of the task.
Implementation
TaskHandle refreshRouteWithTraveledDistanceAndRoutingOptions(RouteHandle routeHandle, Waypoint? startingPoint, int? lastTraveledSectionIndex, int? traveledDistanceOnLastSectionInMeters, RoutingOptions options, CalculateRouteCallback callback);