rememberMapViewState
fun rememberMapViewState(key: String? = null, initialCameraOptions: InitialCameraOptions, initialStyle: StyleDescriptor = StandardStyles.TomTomOrbisMaps.BROWSING, renderToTextureView: Boolean = false, init: MapViewState.() -> Unit = {}): MapViewState
Remembers and returns the MapViewState. The state is remembered across recompositions.
This function ensures that the MapViewState persists across configuration changes and recompositions in a Compose environment.
Important: Use named parameters to avoid ambiguous method calls due to API changes.
Parameters
key
The key to use to identify the map. Required to use multiple TomTomMaps in the same view model scope.
initialCameraOptions
The initial camera options.
initialStyle
The initial style of the map. The default value is StandardStyles.TomTomOrbisMaps.BROWSING.
renderToTextureView
If set to true render to texture view rather than surface view. The default value is false.
init
A lambda for initializing the MapViewState with custom settings.