Is there any way of clustering points by field from properties object? I am using react-map-gl library.
https://visgl.github.io/react-map-gl/examples/clusters
Example feature object:
{
type: "Feature",
geometry: {
type: "Point",
coordinates: cords,
},
properties: {
...item,
layer_id: item.id,
name: item.name,
FIELD_TO_CLUSTER_BY: example
},
};
<Source
id="markers"
type="geojson"
data={features}
cluster={true}
clusterMaxZoom={14}
clusterRadius={50}
clusterProperties={{
}}
>
<Layer {...clusterLayer} />
<Layer {...unclusteredPointLayer} />
</Source>
In radius of 50 i would like to cluster all markers that FIELD_TO_CLUSTER_BY equals to 'something'
I was thinking about grouping data by FIELD_TO_CLUSTER_BY and create separate source and layer for each of them.