mapbox minClusterPoints 方法设置为 1 不起作用

问题描述 投票:0回答:0

我想使用 MapLibre(mapbox 的开源替代品)GL-JS 对点进行聚类。 因为我不想在地图上渲染点,所以我尝试使用方法 minClusterPoints documentation: 并将值设置为 1(默认值为 2)

我希望即使对于地理上孤立的点,这也会导致 MapLibre 渲染集群,但不知何故它不起作用。 as you can see here, MapLibre does not generate a cluster for the two isolated points

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)
});

这里是对应的代码。 有什么建议吗?

mapbox mapbox-gl-js maplibre-gl
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.