ArrivalObserver

interface ArrivalObserver

This gives many observers the ability to monitor the progress of arrival. To control the behavior of arrival, see ArrivalController.

Functions

Link copied to clipboard
abstract fun onFinalDestinationArrival(routeProgress: RouteProgress)

Triggered when the RouteProgress.currentState is equal to RouteProgressState.COMPLETE, once when there are no more route legs to navigate.

Link copied to clipboard
abstract fun onNextRouteLegStart(routeLegProgress: RouteLegProgress)

Called when MapboxNavigation.navigateNextRouteLeg has been called and returns true, this observer will be notified of the next route leg start.

Link copied to clipboard
abstract fun onWaypointArrival(routeProgress: RouteProgress)

Triggered when the RouteProgress.currentState is equal to RouteProgressState.COMPLETE, once per route leg, and when there are more route legs to navigate. If we're on the last leg of the route onFinalDestinationArrival is called instead. If you want to provide different experiences for arriving at different types of waypoints (e. g. regular or EV), you can look up the waypoint type via RouteLegProgress.legDestination.