setActiveRoutePlan

abstract fun setActiveRoutePlan(routePlan: RoutePlan)

Sets a provided routePlan as active.

Note: This method is exclusively callable after navigation has been already started. Use this method to manually update the active route during the navigation session. If the method is called before navigation has been started, it will have no effect.

If the navigation has been successfully started with an active route plan, then this method replaces the current active route with the provided one. The navigation session continues with the new route plan.

If the navigation has been started without an active route plan, then the navigation session continues with the provided routePlan. The navigation session transitions from NavigationState.FreeDriving to NavigationState.ActiveGuidance state.

Note: To keep navigation guidance consistent, ensure that before calling this method, the provided routePlan does not contain the DepartureInstruction as the first instruction; this instruction solely indicates the start of navigation.

As a result of successful action, the following listeners are notified:

As a result of successful action, the following listeners may be notified:

Note that the initial instances of navigation engines are used in the new navigation session.

Parameters

routePlan

A route plan to be set as active.

Throws

if the vehicle used for navigation is incompatible with the given route plan.