Skip to content

Commit 6a73378

Browse files
committed
handle mapbox.layers relayouts
1 parent 6254578 commit 6a73378

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/plot_api/plot_api.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,19 @@ Plotly.relayout = function relayout(gd, astr, val) {
22862286
Images.supplyLayoutDefaults(gd.layout, gd._fullLayout);
22872287
Images.draw(gd);
22882288
}
2289+
else if(p.parts[0] === 'mapbox' && p.parts[1] === 'layers') {
2290+
Lib.extendDeepAll(gd.layout, Lib.objectFromPath(ai, vi));
2291+
2292+
// append empty container to mapbox.layers
2293+
// so that relinkPrivateKeys does not complain
2294+
2295+
var fullLayers = (gd._fullLayout.mapbox || {}).layers || [];
2296+
var diff = (p.parts[2] + 1) - fullLayers.length;
2297+
2298+
for(i = 0; i < diff; i++) fullLayers.push({});
2299+
2300+
doplot = true;
2301+
}
22892302
// alter gd.layout
22902303
else {
22912304
// check whether we can short-circuit a full redraw

0 commit comments

Comments
 (0)