Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28125a4

Browse files
committed
simplify purge layer step
1 parent a4a9100 commit 28125a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/plots/mapbox/mapbox.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,12 @@ proto.updateLayers = function() {
303303
// delete them all, and start all over.
304304

305305
if(layers.length !== layerList.length) {
306-
for(i = layerList.length - 1; i > -1; i--) {
306+
for(i = 0; i < layerList.length; i++) {
307307
layerList[i].dispose();
308-
layerList.pop();
309308
}
310309

310+
layerList = this.layerList = [];
311+
311312
for(i = 0; i < layers.length; i++) {
312313
layerList.push(createMapboxLayer(this, i, layers[i]));
313314
}

0 commit comments

Comments
 (0)