Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove layers from last to first
  • Loading branch information
etpinard committed Jun 28, 2019
commit 1add90efdfb7d930ff3c0c880199cdeef776b5e2
2 changes: 1 addition & 1 deletion src/traces/choroplethmapbox/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ proto._removeLayers = function() {
var map = this.subplot.map;
var layerList = this.layerList;

for(var i = 0; i < layerList.length; i++) {
for(var i = layerList.length - 1; i >= 0; i--) {
map.removeLayer(layerList[i][1]);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/traces/densitymapbox/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ proto._removeLayers = function() {
var map = this.subplot.map;
var layerList = this.layerList;

for(var i = 0; i < layerList.length; i++) {
for(var i = layerList.length - 1; i >= 0; i--) {
map.removeLayer(layerList[i][1]);
}
};
Expand Down