googlemaps / googlemaps/android-maps-compose

GoogleMap inside a Dialog glitches and shows unwanted trasparency

Open
#588 12 comments 2 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

Please be sure to include as much information as possible:

#### Environment details

OS type and version: Android 14 (issue discovered only on Google Pixel 7a)
Library and version: com.google.maps.android:maps-compose:5.0.3
Compose version: BOM 2024.04.00, Compiler 1.5.10

#### Steps to reproduce

1. Create a simple layout with some content
2. Add a composable Dialog on top of this content
3. Put a GoogleMap inside the aforementioned dialog
4. Pan and Zoom the map and look closely around streets or railways in particular, you will notice a slight transparency around the border of map's elements that allows to see content beneath the dialog.

#### Code example

```
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Row(modifier = Modifier.fillMaxSize()) {
Box(Modifier.weight(1f).fillMaxHeight().background(Color.Red))
Box(Modifier.weight(1f).fillMaxHeight().background(Color.Green))
Box(Modifier.weight(1f).fillMaxHeight().background(Color.Blue))
}
Dialog(
onDismissRequest = {},
) {
GoogleMap()
}
}
}
}
```
#### Screenshots
![Screenshot_20240624-145451](https://github.com/googlemaps/android-maps-compose/assets/162339850/3f0de251-a504-417e-8e6e-674224a847e3)

![Screenshot_20240624-145451](https://github.com/googlemaps/android-maps-compose/assets/162339850/48013b2d-b6dd-43c1-a1b5-1a0e7d818396)

##### This is what happens in our app, sometimes it glitches even worse
![Screenshot_20240624-151916](https://github.com/googlemaps/android-maps-compose/assets/162339850/4664d8f2-4c9e-4f32-952d-43cc1fe0467a)

#### Footnote
This issue has only been observed on Google Pixel 7a, we tested 2 different 7a and both of them have this issue. Other phones with android 14 including S23 ultra and Pixel 4a do not have this issue.

We have also tried to:
- put a colored box inside the dialog and behind the map
- draw a filled rectangle with drawBehind modifier
- set the GoogleMapOptions.backgroundColor property
but neither of those have resolved the issue.

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.