mirror of
https://github.com/googlemaps/android-samples.git
synced 2025-12-08 18:02:20 +00:00
fix: using rememberMarkerState instead of MarkerState (#1768)
This commit is contained in:
parent
cb53eb4999
commit
6007cc87f5
@ -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"
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user