DynamicRoutingListener (API Reference)
Interface DynamicRoutingListener
This interface should be implemented in order to
receive notifications about the new route via the DynamicRoutingEngine.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonBetterRouteFound(Route newRoute, int etaDifferenceInSeconds, int distanceDifferenceInMeters) This event is issued when a better route could be found, as defined byDynamicRoutingEngineOptions.voidonRoutingError(RoutingError routingError) This event is issued when an error occurred.
-
Method Details
-
onBetterRouteFound
void onBetterRouteFound(@NonNull Route newRoute, int etaDifferenceInSeconds, 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.- Parameters:
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.
-
onRoutingError
This event is issued when an error occurred.
- Parameters:
routingError-Routing error
-