googlemaps / googlemaps/android-maps-compose
Setting contentPadding offset the cameraPosition
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
Hi,
When adding a contentPadding to the Google map, the map's cameraPosition is never centered on the screen :

The default marker is the position given to the map and the little work icon is at the center of the screen with the same map paddings.
#### Environment details
Android Maps Compose version : 2.2.1
#### Code example
```
val bottomSheetPadding = remember { PaddingValues(bottom = 40.dp) }
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(LatLng(0.0, 0.0), 17f)
}
GoogleMap(
modifier = modifier.fillMaxSize(),
cameraPositionState = cameraPositionState,
contentPadding = bottomSheetPadding
) {
Marker(state = rememberMarkerState(position = LatLng(0.0, 0.0)))
}
Image(
painter = painterResource(ic_work),
contentDescription = null,
modifier = Modifier
.align(Center)
.padding(bottomSheetPadding)
.padding(bottom = 24.dp) // Icon size /2
.size(48.dp)
)
```
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.