HorizonUpdatedListener

Interface to horizon update listeners. Used to receive horizon update events during navigation.

To listen to horizon updates while navigating, first implement this interface to create a listener, for example:

val horizonUpdatedListener = object : HorizonUpdatedListener {
override fun onSnapshotUpdated(options: HorizonOptions, snapshot: HorizonSnapshot) {
// add code here that handles the horizon snapshot update
}
override fun onPositionUpdated(options: HorizonOptions, position: HorizonPosition) {
// add code here that handles the horizon position update
}
}

Then, add the listener you created with the TomTomNavigation object for the set of horizon options for which you wish to receive an update. To do that, use addHorizonUpdatedListener:

tomTomNavigation.addHorizonUpdatedListener(horizonOptions, horizonUpdatedListener)

To stop listening to horizon updates, remove the listener using removeHorizonUpdatedListener:

tomTomNavigation.removeHorizonUpdatedListener(horizonUpdatedListener)

Functions

Link copied to clipboard
abstract fun onHorizonReset(options: HorizonOptions)

Called when a horizon reset has occurred for a specific set of horizon options. The horizon is reset following a map update, a vehicle profile update or a route update, or when the current input position does not belong to any of the existing horizon paths (for example, a jump to a new place).

Link copied to clipboard
abstract fun onPositionUpdated(options: HorizonOptions, position: HorizonPosition)

Called when the horizon position has been updated for a specific set of horizon options.

Link copied to clipboard
abstract fun onSnapshotUpdated(options: HorizonOptions, snapshot: HorizonSnapshot)

Called when the horizon snapshot has been updated for a specific set of horizon options.