diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index 1b9ab2f8c..2c47dd143 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -136,7 +136,7 @@ iD.Map = function(context) { .call(midpoints, graph, all, filter, map.extent()) .call(labels, graph, all, filter, dimensions, !difference && !extent); - if (points.points(context.intersects(map.extent())).length > 100) { + if (points.points(context.intersects(map.extent()), 100).length >= 100) { surface.select('.layer-hit').selectAll('g.point').remove(); } else { surface.call(points, points.points(all), filter); diff --git a/js/id/svg/points.js b/js/id/svg/points.js index e28ee1062..cd3de9d8a 100644 --- a/js/id/svg/points.js +++ b/js/id/svg/points.js @@ -50,7 +50,7 @@ iD.svg.Points = function(projection, context) { .remove(); } - drawPoints.points = function(entities) { + drawPoints.points = function(entities, limit) { var graph = context.graph(), points = []; @@ -58,6 +58,7 @@ iD.svg.Points = function(projection, context) { var entity = entities[i]; if (entity.geometry(graph) === 'point') { points.push(entity); + if (limit && points.length >= limit) break; } }