From 6007cc87f5ab61d7e5146b3f5eb8dc193037f446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20L=C3=B3pez=20Ma=C3=B1as?= Date: Wed, 28 Aug 2024 00:10:31 +0200 Subject: [PATCH] fix: using rememberMarkerState instead of MarkerState (#1768) --- .../src/main/java/com/example/app_compose/MapsCompose.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/app-compose/src/main/java/com/example/app_compose/MapsCompose.kt b/snippets/app-compose/src/main/java/com/example/app_compose/MapsCompose.kt index 334a1e557..750d71481 100644 --- a/snippets/app-compose/src/main/java/com/example/app_compose/MapsCompose.kt +++ b/snippets/app-compose/src/main/java/com/example/app_compose/MapsCompose.kt @@ -39,6 +39,7 @@ import com.google.maps.android.compose.rememberCameraPositionState fun AddAMap() { // [START maps_android_compose_add_a_map] val singapore = LatLng(1.35, 103.87) + val singaporeState = rememberMarkerState(position = singapore) val cameraPositionState = rememberCameraPositionState { position = CameraPosition.fromLatLngZoom(singapore, 10f) } @@ -47,7 +48,7 @@ fun AddAMap() { cameraPositionState = cameraPositionState ) { Marker( - state = MarkerState(position = singapore), + state = MarkerState(position = singaporeState), title = "Singapore", snippet = "Marker in Singapore" )