Clustering: Handling clusters in same location
Thank you very much for all your work on the library and the recent work on clustering.
I was having a play with the clustering library and wondered how we can handle pins when they're too close together.
E.g. in Bangkok I have the following 4 pins:
latitude=13.720681, longitude=100.515331 latitude=13.72066, longitude=100.515344 latitude=13.720681, longitude=100.515331 latitude=13.720681, longitude=100.515331
For the onClusterClick I have basically done this:
cameraPositionState.animate(
CameraUpdateFactory.newLatLngZoom(
cluster.position,
cameraPositionState.position.zoom + 1))
But after a while it doesn't really do anything and after 20.0f zoom nothing changes. Are there some examples of how to explode these out once any further zoom will not expand the cluster? It would be nice if I could skip intermediate zoom levels that won't change the state of the cluster too, if I knew how to calculate whether a zoom would change the clustering.
Also does the zIndex actual work on the clusterItemContent? I tried doing this:
Image(
painterResource(drawable),
contentDescription = item.title,
Modifier.zIndex(if (isCurrent) 1f else 0f)
)
but the pins never rearrange when one of them becomes current.
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@barry-irvine Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.
I found some work-arounds for old non-compose clustering like Make Your own Cluster Rendering or change maxZoom. But it doesn't work for the compose version.
i'm also missing the ability to set the zIndex of clusters and cluster items. Currently i have the problem that the clusters (and items) are overlayed by other markers where i need to define zIndex