You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@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 getLeaves() on the super cluster and pass it the cluster ID to get all the points in that cluster.
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: