-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass Features to the ClusterMarker component #30
Comments
This is something I would really love to do as well – list the markers under one cluster. Would be an awesome feature! |
@Ancinek I ended up creating my own implementation of this supercluster feature using use-supercluster and I simply passed the supercluster to the custom marker along with the cluster id. By doing that I could call |
Is your feature request related to a problem? Please describe.
The ClusterMarker component is only passed a few props - one of them being the count of points in the cluster so that it can be rendered as a label to the cluster. I have a need to click on that cluster and, in a separate pane, see a list of the points in that cluster. It would be nice to pass all the features in that cluster to the ClusterMarker so that they can be accessed. Then, to render the label, you simply need to show the length of the array of features.
Describe the solution you'd like
Pass the features to the ClusterMarker component as a prop.
Describe alternatives you've considered
I've tried accessing the supercluster directly through refs and doing a reverse lookup of the points based on their lat/long coordinates. However, this is really messy and the ref doesn't seem to update as I zoom into the map and the cluster breaks apart into smaller clusters. Seems it would be way easier and cleaner to pass the features directly as a prop.
The text was updated successfully, but these errors were encountered: