improve canvas removeLayer perf, close #3076

This commit is contained in:
Vladimir Agafonkin 2015-07-22 19:37:24 +03:00
parent 45ebba4159
commit 80b8d5f4c9

View File

@ -100,12 +100,13 @@ L.Canvas = L.Renderer.extend({
for (var id in this._layers) {
layer = this._layers[id];
if (!this._redrawBounds || layer._pxBounds.intersects(this._redrawBounds)) {
layer._updatePath();
}
if (clear && layer._removed) {
delete layer._removed;
delete this._layers[id];
} else if (!this._redrawBounds || layer._pxBounds.intersects(this._redrawBounds)) {
layer._updatePath();
}
}
},