Restore differenced point rendering (#569, #1604)

This commit is contained in:
John Firebaugh
2013-06-18 16:23:02 -07:00
parent e6cc20efb5
commit 0689ab7f71
2 changed files with 9 additions and 10 deletions
+6 -1
View File
@@ -138,13 +138,18 @@ iD.Map = function(context) {
}
surface
.call(points)
.call(vertices, graph, all, filter, map.extent(), map.zoom())
.call(lines, graph, all, filter)
.call(areas, graph, all, filter)
.call(midpoints, graph, all, filter, map.extent())
.call(labels, graph, all, filter, dimensions, !difference && !extent);
if (points.points(context.intersects(map.extent())).length > 100) {
surface.select('.layer-hit').selectAll('g.point').remove();
} else {
surface.call(points, points.points(all), filter);
}
dispatch.drawn({full: true});
}
+3 -9
View File
@@ -10,16 +10,11 @@ iD.svg.Points = function(projection, context) {
return b.loc[1] - a.loc[1];
}
function drawPoints(surface, points) {
points = points || drawPoints.points();
if (points.length > 100) {
return surface.select('.layer-hit').selectAll('g.point').remove();
}
function drawPoints(surface, points, filter) {
points.sort(sortY);
var groups = surface.select('.layer-hit').selectAll('g.point')
.filter(filter)
.data(points, iD.Entity.key);
var group = groups.enter()
@@ -55,9 +50,8 @@ iD.svg.Points = function(projection, context) {
.remove();
}
drawPoints.points = function() {
drawPoints.points = function(entities) {
var graph = context.graph(),
entities = context.intersects(context.extent()),
points = [];
for (var i = 0; i < entities.length; i++) {