Created
June 1, 2022 19:34
-
-
Save arriolac/d771987ea59f60dab1a2b2dbabf05949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
val singapore = LatLng(1.35, 103.87) | |
val cameraPositionState = rememberCameraPositionState { | |
position = CameraPosition.fromLatLngZoom(singapore, 11f) | |
} | |
Box(Modifier.fillMaxSize()) { | |
GoogleMap( | |
modifier = Modifier.matchParentSize(), | |
cameraPositionState = cameraPositionState | |
) | |
val coroutineScope = rememberCoroutineScope() | |
Button(onClick = { | |
coroutineScope.launch { | |
cameraPositionState.animate( | |
CameraUpdateFactory.zoomIn() | |
) | |
} | |
}) { | |
Text(text = "Zoom in") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment