Allow option of zooming in just enough so that the markers are unclustered, as opposed to zooming in just on the clustered markers #745
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
For our implementation, we don't particularly want to zoom in all the way on the markers, it can be a bit annoying for how the map is used in our product. As a result when the cluster is clicked, you have to zoom back out some afterwards, even though the markers are still not clustered after zooming out.
I'd like an option for the library to allow you to zoom in just enough that is required to de-cluster. It seems like it could potentially be a straightforward addition, as you could just leverage the
getClusterExpansionZoom
function that already exists in supercluster.The alternative for us would likely involve leveraging the supercluster library itself to find the required zoom value, and then using that value in an onClick handler for the clusters. But it feels a bit redundant to pass in the markers to this library, which invokes supercluster, and then we just do that again with the same markers on our end just to get a value that we pass back to this library. If markerclusterer gave us access to the instantiated supercluster, we could also simply leverage that to call the function ourselves, but markercluster seems to hide/abstract this away, and I'm not sure why. Even the clusters/markers that are returned from this library do not have all of the values on them that supercluster attaches to its return values, but rather maps over them a returns a slightly simpler object. I'm sure there's a reason for it, but from my perspective, the more information I potentially have access to, the more useful it is.
The text was updated successfully, but these errors were encountered: