googlemaps / googlemaps/android-maps-compose

Can't use Marker as a default clusterItemContent

Aperta
#310 5 commenti 2 reazioni 1 assegnatario Rivendicata da @dkhawk Vedi su GitHub
priority: p1 type: bug
Lingua principale
Kotlin
Stelle
1.3k
Fork
181
Merge medio
2g 23h
PR unite (30g)
18

Descrizione

I wanted to use default markers and change the color of the selected ones. But I can't use even a default Marker as a clusterItemContent because of the error:
`java.lang.IllegalArgumentException: width and height must be > 0`
I can't change the size of the Marker because it doesn't have a Modifier parameter. So, how can I change the color of the selected marker as before (or in more optimal way), disable titles, snippets etc.?

```
clusterItemContent = {
Marker(
//icon = it.getMarkerDescriptor(selectedEvent == it)
)
}

fun getMarkerDescriptor(isSelected: Boolean = false): BitmapDescriptor? =
if (isSelected) BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE) else null
```
P.S. If I use a custom icon, it drastically decrease performance (especially in debug mode). Is there a way to optimize it?
P.P.S. With a custom icon, I also can't disable snippets and title - only sending null in the data. (The way it doesn't show is to send `true` in `onClusterItemClick`)
```
clusterItemContent = {
Icon(imageVector = Icons.Filled.Abc, it.name)
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.