Remove elements for faster panning

This commit is contained in:
Tom MacWright
2012-11-15 15:59:01 -05:00
parent 43a36c4867
commit ca55c8d88c
2 changed files with 11 additions and 1 deletions

View File

@@ -50,7 +50,6 @@ iD.Connection = function() {
role: elems[i].attributes.role.nodeValue
};
}
return members;
}

View File

@@ -162,6 +162,14 @@ iD.Map = function(elem) {
hit_g.selectAll('rect.handle').remove();
}
function hideFills() {
fill_g.selectAll('path').remove();
}
function hideMarkers() {
hit_g.selectAll('g.marker').remove();
}
function drawFills(areas) {
var fills = fill_g.selectAll('path').data(areas, key);
fills.exit().remove();
@@ -378,6 +386,9 @@ iD.Map = function(elem) {
if (fast) {
if (!translateStart) translateStart = d3.event.translate.slice();
hideHandles();
hideFills();
hideMarkers();
fastPan(d3.event.translate, translateStart);
} else {
redraw();