onBetterRouteFound abstract method

void onBetterRouteFound(
  1. Route newRoute,
  2. int etaDifferenceInSeconds,
  3. int distanceDifferenceInMeters
)

This event is issued when a better route could be found, as defined by DynamicRoutingEngineOptions.

To find a better route, two routes are calculated. The updated current route: A route that is calculated via the route specified. The dynamic route: A route that starts at the current position on the route specified and passes through the remaining waypoints.

  • newRoute The newly calculated route with the remaining waypoints starting from the current location.

  • etaDifferenceInSeconds The difference in seconds: eta of the current updated route - eta of the dynamic route.

  • distanceDifferenceInMeters The difference in meters: distance of the current updated route - distance of the dynamic route. The value can be negative in case the current updated route has a shorter distance, but its now assumed to be longer than the dynamic route.

Implementation

void onBetterRouteFound(Route newRoute, int etaDifferenceInSeconds, int distanceDifferenceInMeters);