Skip to content

Commit e0ab8fd

Browse files
fixed issue 6508 of plotly.js.
renamed variable currentLayerId.
1 parent 6c33613 commit e0ab8fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/traces/scattermapbox/plot.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ proto.addLayer = function(k, opts, below) {
8181
if(opts.filter) {
8282
source.filter = opts.filter;
8383
}
84-
var layerId = this.layerIds[k];
84+
var currentLayerId = this.layerIds[k];
8585
var layerExist = this.subplot.getMapLayers().filter(function(mbLayer) {
86-
return mbLayer.id === layerId;
86+
return mbLayer.id === currentLayerId;
8787
});
88-
if(layerExist.length) {
89-
this.subplot.map.removeLayer(layerId);
88+
if(layerExist && layerExist.length) {
89+
this.subplot.map.removeLayer(currentLayerId);
9090
}
9191
this.subplot.addLayer(source, below);
9292
};

0 commit comments

Comments
 (0)