Skip to content

Commit a0bfe09

Browse files
authored
Merge pull request #900 from plotly/mapbox-visible-false
Fix mapbox visible false first draw
2 parents 76f1c57 + 96b2dde commit a0bfe09

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/plots/mapbox/mapbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ proto.updateData = function(calcData) {
212212
traceObj = traceHash[trace.uid];
213213

214214
if(traceObj) traceObj.update(calcTrace);
215-
else {
215+
else if(trace._module) {
216216
traceHash[trace.uid] = trace._module.plot(this, calcTrace);
217217
}
218218
}

test/jasmine/tests/mapbox_test.js

+6
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ describe('mapbox plots', function() {
295295
}).then(function() {
296296
expect(countVisibleTraces(gd, modes)).toEqual(2);
297297

298+
mock.data[0].visible = false;
299+
300+
return Plotly.newPlot(gd, mock.data, mock.layout);
301+
}).then(function() {
302+
expect(countVisibleTraces(gd, modes)).toEqual(1);
303+
298304
done();
299305
});
300306
});

0 commit comments

Comments
 (0)