NavigationApi

Properties

Link copied to clipboard
open override val errorsState: StateFlow<Errors>

SDK and navigation errors state - monitor it to resolve problems (for example enable internet connection, gps etc.) or contact with developer (for example API key expired etc.) Custom implementation of StateFlow guarantees all changes to be notify - no conflation.

Link copied to clipboard
open override val etaDataState: StateFlow<EtaModel?>

A StateFlow representing eta data required by EtaBar. Pass this to the composable EtaBar as the speedState parameter.

Link copied to clipboard
open override val laneAssistantState: StateFlow<LaneAssistantModel?>

A StateFlow representing data required by the LaneAssistant composable. Pass this to the composable LaneAssistant.

Link copied to clipboard
open override val locationState: StateFlow<LocationModel?>

A StateFlow providing data for position tracking and displaying an indicator on a map.

Link copied to clipboard
open override val maneuversDataState: StateFlow<ManeuversModel?>

A StateFlow representing upcoming maneuver information ManeuversBar. Pass this to the composable ManeuversBar.

Link copied to clipboard
open override val navigationState: StateFlow<NavigationState>

A StateFlow representing the current state of the navigation session

Link copied to clipboard
open override val routesDataState: StateFlow<RoutesModel?>

A StateFlow providing data drawing route or showing route bounds.

Link copied to clipboard
open override val sdkState: StateFlow<SdkState>

A StateFlow representing the current state of the SDK

Link copied to clipboard
open override val soundState: StateFlow<SoundState>

A StateFlow providing data about current voice guidance state.

Link copied to clipboard
open override val speedState: StateFlow<SpeedModel?>

A StateFlow representing current speed and speedLimit. Pass this to the composable SpeedView

Functions

Link copied to clipboard
open suspend override fun awaitNavigationState(state: NavigationState, action: () -> Unit?)

Helper method that suspends until Navigation reaches desired state (and launches action if defined).

Link copied to clipboard
open suspend override fun awaitSdkAndNavigationState(sdkState: SdkState, navigationState: NavigationState, action: () -> Unit?)

Helper method that suspends until SDK and Navigation reaches desired state (and launches action if defined).

Link copied to clipboard
open suspend override fun awaitSdkState(state: SdkState, action: () -> Unit?)

Helper method that suspends until SDK reaches desired state (and launches action if defined).

Link copied to clipboard
open override fun canStopNavigation(): Boolean

Helper method that indicates if navigation can be stopped.

Link copied to clipboard
open override fun dispose()

Stops any ongoing operations (including location tracking or foreground service if active etc.), cleans up internal state and releasing resources. Call this when NavigationApi is no longer needed.

Link copied to clipboard

Retrieves the IOverlayViewModel associated with the provided ViewModelStoreOwner (typically an Activity or Fragment). This ViewModel is designed for use with the NavigationMapView composable function.

Link copied to clipboard
open override fun init(initParams: InitParams)

Initializes the SDK with the provided init parameters. This method must be called before any other SDK operations.

Link copied to clipboard
@RequiresPermission(allOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"])
open override fun navigate(navigationParams: NavigationParams)

Initiates navigation to the specified parameters.

Link copied to clipboard
open override fun sendReport(reportParams: ReportParams): Deferred<Boolean>

Sends a report to the server.

Link copied to clipboard
@RequiresPermission(allOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"])
open override fun startLocationTracking()

Initiates requests for location updates.

Link copied to clipboard
open override fun startNavigationActivity(context: Context, stopNavigationOnActivityDestroy: Boolean)

Starts default activity with map and all navigation views to visualise active navigation session.

Link copied to clipboard
open override fun startVoiceGuidance()

Enables the voice navigation prompts.

Link copied to clipboard
open override fun stopLocationTracking()

Stops the active location tracking process.

Link copied to clipboard
open override fun stopNavigation()

Stops the currently active navigation session. This will typically stop any ongoing route guidance, remove the navigation UI, and, if a foreground service was started, stop the foreground service.

Link copied to clipboard
open override fun stopVoiceGuidance()

Disables the voice navigation prompts.

Link copied to clipboard
open override fun updateNavigation(event: NavigationEvent.Update, forced: Boolean)

Updates the currently ongoing navigation session.