rememberUpdatedMarkerState

fun rememberUpdatedMarkerState(position: LatLng = LatLng(0.0, 0.0)): MarkerState

This function updates the state value according to the update of the input parameter, like 'rememberUpdatedState'.

This cannot be used to preserve state across configuration changes.


fun rememberUpdatedMarkerState(key: String? = null, position: LatLng = LatLng(0.0, 0.0)): MarkerState

Deprecated

Use 'rememberUpdatedMarkerState' instead - It may be confusing to think that the state is automatically updated as the position changes, so it will be changed or removed.

Replace with


            val markerState = rememberSaveable(key = key, saver = MarkerState.Saver) {
                MarkerState(position)
            }
        

Uses rememberSaveable to retain MarkerState.position across configuration changes, for simple use cases.

Other use cases may be better served syncing MarkerState.position with a data model.

This cannot be used to preserve info window visibility across configuration changes.

This function does not automatically update the MarkerState when the input parameters change. If you need this implementation, use 'rememberUpdatedMarkerState'.