我想使用 MapLibre(mapbox 的开源替代品)GL-JS 对点进行聚类。 因为我不想在地图上渲染点,所以我尝试使用方法 minClusterPoints documentation: 并将值设置为 1(默认值为 2)
我希望即使对于地理上孤立的点,这也会导致 MapLibre 渲染集群,但不知何故它不起作用。
map.addSource('users', {
type: 'geojson',
data: geoJSON,
cluster: true,
clusterMinPoints: 1,
clusterMaxZoom: 10, // Max zoom to cluster points on
clusterRadius: 50, // Radius of each cluster when clustering points (defaults to 50)
});
这里是对应的代码。 有什么建议吗?