RouteAddedListener

fun interface RouteAddedListener

Used to inform 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:

In order to listen to the route being added to the session, implement this interface to create a listener, for instance:

val routeAddedListener = RouteAddedListener { route, options, reason ->
// Implement the necessary functionality for handling the route being added to the session
}

Subsequently, 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 whenever a route has been added to the navigation session.