refreshRouteWithRouteHandleAndRoutingOptions abstract method

TaskHandle refreshRouteWithRouteHandleAndRoutingOptions(
  1. RouteHandle routeHandle,
  2. Waypoint startingPoint,
  3. RoutingOptions options,
  4. 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. Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • routeHandle The route handle holding the route to be refreshed.

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

  • options The options define the vehicle and route options to calculate the route.

  • callback Callback 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 refreshRouteWithRouteHandleAndRoutingOptions(RouteHandle routeHandle, Waypoint startingPoint, RoutingOptions options, CalculateRouteCallback callback);