setActiveRoutePlan

abstract fun setActiveRoutePlan(routePlan: RoutePlan?)

Sets a provided routePlan as active. As a result of calling the method with a null argument, the navigation session transitions from NavigationState.ActiveGuidance to NavigationState.FreeDriving.

Note: If the navigation is in NavigationState.FreeDriving state and the method will be called with null argument, it will have no effect.

Note: This method is exclusively callable after navigation has already started. Use this method to manually update the active route during the navigation session. If the method is called before navigation has 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 successfully invoking this method with a non-null routePlan, the following listeners are notified:

As a result of successfully invoking this method with a non-null routePlan, the following listeners may be notified:

As a result of successfully invoking this method with a null argument, the following listeners are 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.