googlemaps / googlemaps/android-maps-compose
StreetView Composable is drawn outside of clipping area
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
[StreetView](https://github.com/googlemaps/android-maps-compose/blob/main/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetView.kt) composable doesn't fully respect the parent's and its own clip area.
#### Environment details
We tested it in Android 13 & 14.
**Versions**:
- 4.3.0 of com.google.maps.android:maps-compose
- 1.1.2 of androidx.compose.material3:material3
#### Steps to reproduce
Put the `StreetView` inside a `Card` or `ModalBottomSheet` with rounded corners where the street view fills out to each side. The street view will be drawn outside of the rounded corners, no matter if you put `Modifier.clip` on the `StreetView` itself or the parent Composable.
Also tried adding `shape` to the `Card` and no `Modifier.clip` applied on the `StreetView`, but got the same result.
ℹ️ There was the same [bug report](https://github.com/googlemaps/android-maps-compose/issues/199) for the Composable `GoogleMap` which is `Closed` now but there is a [comment](https://github.com/googlemaps/android-maps-compose/issues/199#issuecomment-1415555634) that it still doesn't work.
#### Code example
```
Card(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(20.dp)),
){
StreetView(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
.height(200.dp),
cameraPositionState = cameraPositionState,
streetViewPanoramaOptionsFactory = {
StreetViewPanoramaOptions().position(position, StreetViewSource.OUTDOOR)
},
)
}
```
Example screenshot from a `ModalBottomSheet` with `RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp)` shape and `Modifier.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))` applied to `StreetView`.
Contributor guide
Assessment
This issue has not been assessed yet.