Question: How do you create a minPoints option?
hawaiifi opened this issue · comments
hawaiifi commented
So that a cluster isn't created unless there are a minimum number of points.
As an example, I don't want to show a cluster unless it has more than 2 points.
Leigh Halliday commented
Hey @hawaiifi ! Supercluster itself doesn't have an option for minPoints
, but what you might be able to do is something like this:
if (cluster.properties.point_count >= 2) {
// return marker representing cluster
} else {
const clusterPoints = supercluster.getChildren(cluster.id);
return clusterPoints.map(point => <Marker ... />);
}
This way if a cluster has only 2 points in it, you can just grab those points and render them instead.