startMapStateObservation

abstract fun startMapStateObservation(mapView: MapView, scope: CoroutineScope): Job

Start observing the app's map state and applying changes to the MapView.

Called once after MapView initialization. The implementation should collect the app's state flow and call the appropriate MapView update methods for each state change. The returned Job is cancelled during cleanup.

Without this observation, camera changes (from gestures, centerOn, zoom) and map state changes (style, POIs, traffic) won't be reflected on the Android Auto MapView.

Return

A Job that the SDK cancels during cleanup

Parameters

mapView

The MapView to apply state changes to

scope

CoroutineScope for launching the observation coroutine