rememberMapViewState

@Composable
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. When using multiple TomTomMap instances within the same androidx.lifecycle.ViewModelStoreOwner scope (for example, in the same Activity/Fragment), this key must be set and unique per map.

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.