LaneGuidanceUpdatedListener

Informs the caller about changes in lane guidance. This interface provides listeners for when lane guidance starts and ends.

The LaneGuidanceUpdatedListener interface provides the methods which are triggered when lane guidance shall appear and disappear, respectively. These methods facilitate efficient and dynamic update of lane guidance information during a journey.

Note: To ensure these methods are triggered, the Route passed to TomTomNavigation must contain valid LaneSections. This code is used within the context of a navigation system where lane guidance is crucial for the user experience and journey accuracy.

To listen to the lane guidance changes, first implement this interface to create a listener, for example:

val laneGuidanceUpdatedListener = object : LaneGuidanceUpdatedListener {
override fun onLaneGuidanceStarted(laneGuidance: LaneGuidance) {
// add code here that handles the lane guidance starting
}
override fun onLaneGuidanceEnded(laneGuidance: LaneGuidance) {
// add code here that handles the lane guidance ending
}
}

Then register this listener using TomTomNavigation.addLaneGuidanceUpdatedListener. To stop listening to the lane guidance changes, unregister the listener using TomTomNavigation.removeLaneGuidanceUpdatedListener.

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

Functions

Link copied to clipboard
abstract fun onLaneGuidanceEnded(laneGuidance: LaneGuidance)

Triggered when current lane guidance ends.

Link copied to clipboard
abstract fun onLaneGuidanceStarted(laneGuidance: LaneGuidance)

Triggered when new lane guidance appears.