Skip to content

Commit

Permalink
fix: import rememberMarkerState and use the marker state correctly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhawk authored Aug 28, 2024
1 parent 6007cc8 commit 5095437
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import com.google.maps.android.compose.MapProperties
import com.google.maps.android.compose.MapType
import com.google.maps.android.compose.MapUiSettings
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.rememberCameraPositionState
import com.google.maps.android.compose.rememberMarkerState

@Composable
fun AddAMap() {
// [START maps_android_compose_add_a_map]
val singapore = LatLng(1.35, 103.87)
val singaporeState = rememberMarkerState(position = singapore)
val singaporeMarkerState = rememberMarkerState(position = singapore)
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(singapore, 10f)
}
Expand All @@ -48,7 +48,7 @@ fun AddAMap() {
cameraPositionState = cameraPositionState
) {
Marker(
state = MarkerState(position = singaporeState),
state = singaporeMarkerState,
title = "Singapore",
snippet = "Marker in Singapore"
)
Expand Down

0 comments on commit 5095437

Please sign in to comment.