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 routeUpdated = RouteUpdatedListener { route, updateReason ->
// add code here that handles the route being updated
}

Then register this listener using TomTomNavigation.addRouteUpdatedListener. To stop listening to the route being updated, unregister 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.

Important: This is a Public Preview API. It may be changed or removed at any time.

Functions

Link copied to clipboard
abstract fun onRouteUpdated(route: Route, updateReason: RouteUpdateReason)

Called whenever Route has been successfully updated.