Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created June 1, 2022 19:34
Show Gist options
  • Save arriolac/d771987ea59f60dab1a2b2dbabf05949 to your computer and use it in GitHub Desktop.
Save arriolac/d771987ea59f60dab1a2b2dbabf05949 to your computer and use it in GitHub Desktop.
// 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