addOffRouteListener

fun addOffRouteListener(offRouteListener: OffRouteListener)

This adds a new off route listener which is invoked when the devices location veers off the route and the specified criteria's in MapLibreNavigationOptions have been met.

The behavior that causes this listeners callback to get invoked vary depending on whether a custom off route engine has been set using .setOffRouteEngine.

It is not possible to add the same listener implementation more then once and a warning will be printed in the log if attempted.

Since

0.2.0

Parameters

offRouteListener

an implementation of OffRouteListener which hasn't already been added

See also