mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
try to equally space to be rendered markers in mid zoom levels
closes #10378
This commit is contained in:
@@ -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; });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user