mapbox-gl-js version:0.18.0
Hi
I am new to mapboxgl, I have a question about how I can get all points belong to a certain cluster point? based on the example, I am able to generate a cluster markers and when mouse click on cluster circle, using following code only be able to get total points. so it will be good to have a properties with a array of points in the resource.
var features = mapBox.queryRenderedFeatures(e.point, { layers: ['cluster'] });
if (!features.length) {
return;
}
var feature = features[0];
var totalNum = feature['point_count'];
I hope it can return value from geoJsonSource list this.
{
cluster : 1,
point_count : integer,
point_count_abbreviated : integer,
**points_properties : included points properties array,**
}
Or if there is another solution can solve my problem, it will be great
Thanks
Looking for a similar _Expected Behavior_. I need those points to compute bounds that I will use to call fitBounds on my map object.
I think it will not be fixed anytime soon #2384.
This issue is a duplicate of https://github.com/mapbox/mapbox-gl-js/issues/2358. Sorry! This functionality would be nice but it is not practical.
I understand the way for store all those points in cluster point's properties is ambition. But I wonder is there another way to get those points by a method or calculation from the source. I can see the index process is using kdbush, but i don't know is it possible to generate those points again when click on a cluster point.
@barrylachapelle The results that print don't always reflect the count on the cluster. It would be nice if we could make this more accurate.
bump!
Most helpful comment
https://jsfiddle.net/aznkw784/