RouteAddedListener

fun interface RouteAddedListener

Informs the caller that a route has been added to the navigation session.

A new route can be added to the session under the following circumstances:

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

val routeAddedListener = RouteAddedListener { route, options, reason ->
// add code here that handles the route being added to the session
}

Then add this listener using TomTomNavigation.addRouteAddedListener. To stop listening to the route being added to the session, remove the listener using TomTomNavigation.removeRouteAddedListener.

Please note that RouteAddedListener is triggered only when the replanned route differs from the current active route in terms of geometry. Events like route refresh and increment update of guidance instructions will not trigger this listener. For these scenarios the RouteUpdatedListener is called.

The complementary listener that provides updates on the removal of routes from the session is RouteRemovedListener. IMPORTANT: The addition of a route to the session does not necessarily make it active. To listen to the active route changes, use the ActiveRouteChangedListener.

Functions

Link copied to clipboard
abstract fun onRouteAdded(route: Route, options: RoutePlanningOptions, reason: RouteAddedReason)

Called when a route has been added to the navigation session.