CircuitNavigation

Singleton class that handles circuit navigation. Extends Navigation to provide circuit-specific navigation features.

Circuit navigation allows drivers to follow a closed loop (circuit) with features like:

  • Tracking position and progress in percentage along the circuit

  • Free drive mode when leaving the circuit

  • Automatic detection of rejoining the circuit

  • Tracking missed sections

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Stores circuit length each time start session is called. Can be used for computing the distance from a percentage.

Link copied to clipboard

Circuit Navigation observable methods

Link copied to clipboard

Defines the behavior of the guidance when the driver leaves the path of the circuit. The list of possible behaviors are listed in the RerouteMode enumeration.

Functions

Link copied to clipboard

Registers a circuit navigation listener.

Link copied to clipboard
fun enableFreeDrive(): Error?

During a Circuit Navigation and when the vehicle leaves the route, this function allows the guidance engine to enter in "Free Drive" mode: navigation will cease to guide the driver, who has to rejoin the route without navigation help.

Link copied to clipboard

Converts a geographic position to a percentage along the circuit.

Link copied to clipboard

Converts a percentage along the circuit to a geographic position.

Link copied to clipboard
fun hidePassedCircuit(appContext: Context, hide: Boolean)

Controls the visibility of passed circuit segments on the map.

Link copied to clipboard

Call this function when the listener CircuitNavigationListener.onCanJoinCircuit is called if you want to stop the Free Drive mode and join the circuit.

Link copied to clipboard
open override fun onNewRoute(route: Route, evOptimChargeResult: OptimChargeResult?)

Method called each time a new route has been calculated.

Link copied to clipboard

Clears all circuit navigation listeners.

Link copied to clipboard

Unregisters a circuit navigation listener.

Link copied to clipboard
fun setCircuitAutoResumeDistance(appContext: Context, length: Int)

This option defines the maximum length (in meters) to automatically join the circuit in Free Drive mode. If the vehicle joins the circuit after this distance, the Free Drive will not automatically join, but instead call CircuitNavigationListener.onCanJoinCircuit. CircuitNavigation.joinCircuit must be used in this case.

Link copied to clipboard
fun startSession(appContext: Context? = null, notificationContent: ForegroundNotificationContent? = null, route: Route, instructionsIconsStyles: InstructionsIconsStyles? = null, circuitOptions: CircuitOptions): Error?

Starts a navigation session with optional circuit options.

Link copied to clipboard
fun stopSession(appContext: Context?): Error?

Stops the current navigation session and clears circuit-specific state.