diff --git a/app/src/main/java/com/google/maps/android/compose/AccessibilityActivity.kt b/app/src/main/java/com/google/maps/android/compose/AccessibilityActivity.kt index fcd2a546..3e032238 100644 --- a/app/src/main/java/com/google/maps/android/compose/AccessibilityActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/AccessibilityActivity.kt @@ -37,7 +37,7 @@ class AccessibilityActivity : ComponentActivity() { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { - val singaporeState = rememberMarkerState(initialPosition = singapore) + val singaporeState = rememberMarkerState(position = singapore) val cameraPositionState = rememberCameraPositionState { position = defaultCameraPosition } diff --git a/app/src/main/java/com/google/maps/android/compose/BasicMapActivity.kt b/app/src/main/java/com/google/maps/android/compose/BasicMapActivity.kt index 4cabd722..03be3a67 100644 --- a/app/src/main/java/com/google/maps/android/compose/BasicMapActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/BasicMapActivity.kt @@ -142,11 +142,11 @@ fun GoogleMapView( mapColorScheme: ComposeMapColorScheme = ComposeMapColorScheme.FOLLOW_SYSTEM, content: @Composable () -> Unit = {} ) { - val singaporeState = rememberMarkerState(initialPosition = singapore) - val singapore2State = rememberMarkerState(initialPosition = singapore2) - val singapore3State = rememberMarkerState(initialPosition = singapore3) - val singapore4State = rememberMarkerState(initialPosition = singapore4) - val singapore5State = rememberMarkerState(initialPosition = singapore5) + val singaporeState = rememberMarkerState(position = singapore) + val singapore2State = rememberMarkerState(position = singapore2) + val singapore3State = rememberMarkerState(position = singapore3) + val singapore4State = rememberMarkerState(position = singapore4) + val singapore5State = rememberMarkerState(position = singapore5) var circleCenter by remember { mutableStateOf(singapore) } if (!singaporeState.isDragging) { diff --git a/app/src/main/java/com/google/maps/android/compose/MapInColumnActivity.kt b/app/src/main/java/com/google/maps/android/compose/MapInColumnActivity.kt index 2110ae44..1908df89 100644 --- a/app/src/main/java/com/google/maps/android/compose/MapInColumnActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/MapInColumnActivity.kt @@ -185,7 +185,7 @@ private fun GoogleMapViewInColumn( cameraPositionState: CameraPositionState, onMapLoaded: () -> Unit, ) { - val singaporeState = rememberMarkerState(initialPosition = singapore) + val singaporeState = rememberMarkerState(position = singapore) var uiSettings by remember { mutableStateOf(MapUiSettings(compassEnabled = false)) } var mapProperties by remember { diff --git a/app/src/main/java/com/google/maps/android/compose/RecompositionActivity.kt b/app/src/main/java/com/google/maps/android/compose/RecompositionActivity.kt index 24df349d..d0fc8cd5 100644 --- a/app/src/main/java/com/google/maps/android/compose/RecompositionActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/RecompositionActivity.kt @@ -70,7 +70,7 @@ class RecompositionActivity : ComponentActivity() { cameraPositionState: CameraPositionState = rememberCameraPositionState(), content: @Composable () -> Unit = {}, ) { - val markerState = rememberMarkerState(initialPosition = singapore) + val markerState = rememberMarkerState(position = singapore) val uiSettings by remember { mutableStateOf(MapUiSettings(compassEnabled = false)) } val mapProperties by remember { diff --git a/app/src/main/java/com/google/maps/android/compose/markerexamples/AdvancedMarkersActivity.kt b/app/src/main/java/com/google/maps/android/compose/markerexamples/AdvancedMarkersActivity.kt index 592b91dd..3683e7a9 100644 --- a/app/src/main/java/com/google/maps/android/compose/markerexamples/AdvancedMarkersActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/markerexamples/AdvancedMarkersActivity.kt @@ -70,10 +70,10 @@ class AdvancedMarkersActivity : ComponentActivity(), OnMapsSdkInitializedCallbac val mapProperties by remember { mutableStateOf(MapProperties(mapType = MapType.NORMAL)) } - val marker1State = rememberMarkerState(initialPosition = santiago) - val marker2State = rememberMarkerState(initialPosition = bogota) - val marker3State = rememberMarkerState(initialPosition = lima) - val marker4State = rememberMarkerState(initialPosition = salvador) + val marker1State = rememberMarkerState(position = santiago) + val marker2State = rememberMarkerState(position = bogota) + val marker3State = rememberMarkerState(position = lima) + val marker4State = rememberMarkerState(position = salvador) // Drawing on the map is accomplished with a child-based API val markerClick: (Marker) -> Boolean = { diff --git a/app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt b/app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt index 77764d40..09b8cd48 100644 --- a/app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt @@ -119,7 +119,7 @@ fun GoogleMapClustering(items: List) { } MarkerInfoWindow( - state = rememberMarkerState(initialPosition = singapore), + state = rememberMarkerState(position = singapore), onClick = { Log.d(TAG, "Non-cluster marker clicked! $it") true diff --git a/app/src/main/java/com/google/maps/android/compose/markerexamples/markerdragevents/MarkerDragEventsActivity.kt b/app/src/main/java/com/google/maps/android/compose/markerexamples/markerdragevents/MarkerDragEventsActivity.kt index 419d0156..75dcc799 100644 --- a/app/src/main/java/com/google/maps/android/compose/markerexamples/markerdragevents/MarkerDragEventsActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/markerexamples/markerdragevents/MarkerDragEventsActivity.kt @@ -87,7 +87,7 @@ private fun DraggableMarker( onDrag: (LatLng) -> Unit = {}, onDragEnd: () -> Unit = {} ) { - val markerState = rememberMarkerState(initialPosition = singapore) + val markerState = rememberMarkerState(position = singapore) Marker( state = markerState, diff --git a/app/src/main/java/com/google/maps/android/compose/markerexamples/updatingnodragmarkerwithdatamodel/UpdatingNoDragMarkerWithDataModelActivity.kt b/app/src/main/java/com/google/maps/android/compose/markerexamples/updatingnodragmarkerwithdatamodel/UpdatingNoDragMarkerWithDataModelActivity.kt index b5ef65a7..28fd66f8 100644 --- a/app/src/main/java/com/google/maps/android/compose/markerexamples/updatingnodragmarkerwithdatamodel/UpdatingNoDragMarkerWithDataModelActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/markerexamples/updatingnodragmarkerwithdatamodel/UpdatingNoDragMarkerWithDataModelActivity.kt @@ -152,6 +152,6 @@ fun rememberUpdatedMarkerState(position: LatLng): MarkerState = // rememberUpdatedState() uses MutableState, we use MarkerState. // This is more efficient than updating position in an effect, // as we avoid an additional recomposition. - remember { MarkerState(initialPosition = position) }.also { + remember { MarkerState(position = position) }.also { it.position = position }