Implement a solution to retrieve the cluster leaves of a cluster
See original GitHub issueI think this would benefit a lot of devs trying to handle some action happening when a user clicks on one of the clusters on a map. An example can be to move to a page displaying all the information contained within a cluster. I might be oversimplifying this in my head but the code required mostly already exists in RN code. Since you can click on a cluster and get information from the cluster. The only thing that might need to be ported would be a method that is defined as such in the Android SDK:
features = mMapboxMap.queryRenderedFeatures(pixel, layers); GeoJsonSource source = mMapboxMap.getStyle().getSourceAs(ROUTE_SOURCE_ID);
Then we could use the following methods (using Android in this example) to retrieve all the children.
for (Feature feature : features) { FeatureCollection collection = source.getClusterLeaves(feature, 100,0); }
Again I might be oversimplifying this in my head but as far as I can imagine (with a little native experience) everything except for the last method #getClusterLeaves
is already there.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:7 (2 by maintainers)
Top GitHub Comments
While this is being worked on, for anyone who needs this functionality now I recently implemented Supercluster to do just this. I documented it to hopefully help others: Supercluster with @react-native-mapbox-gl/maps.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.