Only redraw vertices when selection changes

Fixes #1395
This commit is contained in:
John Firebaugh
2013-05-11 19:28:06 -07:00
parent fd1573fa08
commit 21a51be56a
+12 -4
View File
@@ -32,10 +32,6 @@ iD.Map = function(context) {
context.history()
.on('change.map', redraw);
context.on('select.map', function() {
redraw();
});
selection.call(zoom);
supersurface = selection.append('div')
@@ -78,6 +74,18 @@ iD.Map = function(context) {
}
});
context.on('select.map', function() {
if (map.editable() && !transformed) {
var all = context.intersects(map.extent()),
filter = d3.functor(true),
extent = map.extent(),
graph = context.graph();
surface.call(vertices, graph, all, filter, map.zoom());
surface.call(midpoints, graph, all, filter, extent);
dispatch.drawn(map);
}
});
map.size(selection.size());
map.surface = surface;