try to equally space to be rendered markers in mid zoom levels

closes #10378
This commit is contained in:
Martin Raifer
2024-08-07 09:30:46 +02:00
parent 9f643aaae1
commit 7e111944db

View File

@@ -65,7 +65,10 @@ function searchLimited(limit, projection, rtree) {
return partitionViewport(projection)
.reduce(function(result, extent) {
const found = rtree.search(extent.bbox())
let found = rtree.search(extent.bbox());
const spacing = Math.max(1, Math.floor(found.length / limit));
found = found
.filter((_, idx) => idx % spacing === 0)
.slice(0, limit)
.map(function(d) { return d.data; });