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, reason ->
// add code here that handles the route being added to the session
}

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

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

Functions

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

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