RerouteController

interface RerouteController

Reroute controller allows changing the reroute logic externally. Use MapboxNavigation.rerouteController to replace it.

Types

Link copied to clipboard
fun interface RerouteStateObserver

RerouteState observer

Link copied to clipboard
fun interface RoutesCallback

Route Callback is useful to set new route(s) on reroute event. Doing the same as MapboxNavigation.setRoutes.

Functions

Link copied to clipboard
abstract fun interrupt()

Invoked when re-route is not needed anymore (for instance when driver returns to previous route). Might be ignored depending on RerouteState e.g. if a route has been fetched it does not make sense to interrupt re-routing

Link copied to clipboard
abstract fun registerRerouteStateObserver(rerouteStateObserver: RerouteController.RerouteStateObserver): Boolean

Add a RerouteStateObserver to collection and immediately invoke rerouteStateObserver with current re-route state.

Link copied to clipboard
abstract fun reroute(routesCallback: RerouteController.RoutesCallback)

Invoked whenever re-route is needed. For instance when a driver is off-route. Called just after an off-route event.

Link copied to clipboard
abstract fun unregisterRerouteStateObserver(rerouteStateObserver: RerouteController.RerouteStateObserver): Boolean

Remove rerouteStateObserver from collection of observers.

Properties

Link copied to clipboard
abstract val state: RerouteState

Reroute state

Inheritors

Link copied to clipboard