RouteUpdatedListener

fun interface RouteUpdatedListener

Informs the caller that the current route has been updated.

The current route is updated under the following circumstances:

  • When the route data is refreshed with data from the replanned route.

  • When instructions and lane guidance are incrementally updated for the current route.

To listen to the route being updated, first implement this interface to create a listener, for example:

val routeUpdatedListener = RouteUpdatedListener { route, reason ->
// add code here that handles the route being updated
}

Then add this listener using TomTomNavigation.addRouteUpdatedListener. To stop listening to the route being updated, remove the listener using TomTomNavigation.removeRouteUpdatedListener.

Please note that the RouteUpdatedListener is triggered only when the route is updated. It means that the route geometry is preserved. When the route update happens the active route does not change, therefore the ActiveRouteChangedListener is not called. To listen to the route changes that result in the geometry change, use the RouteAddedListener, RouteRemovedListener and ActiveRouteChangedListener.

Functions

Link copied to clipboard
abstract fun onRouteUpdated(route: Route, reason: RouteUpdatedReason)

Called whenever Route has been successfully updated.