Skip to content

Commit 5fc241b

Browse files
committed
separate hasMapbox and hasMap
1 parent 096b347 commit 5fc241b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/fx/layout_defaults.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
2222
// if only mapbox, map or geo subplots is present on graph,
2323
// reset 'zoom' dragmode to 'pan' until 'zoom' is implemented,
2424
// so that the correct modebar button is active
25-
var hasMap = layoutOut._has('mapbox') || layoutOut._has('map');
25+
var hasMapbox = layoutOut._has('mapbox');
26+
var hasMap = layoutOut._has('map');
2627
var hasGeo = layoutOut._has('geo');
2728
var len = layoutOut._basePlotModules.length;
2829

2930
if(layoutOut.dragmode === 'zoom' && (
30-
((hasMap || hasGeo) && len === 1) ||
31-
(hasMap && hasGeo && len === 2)
31+
((hasMapbox || hasMap || hasGeo) && len === 1) ||
32+
((hasMapbox || hasMap) && hasGeo && len === 2)
3233
)) {
3334
layoutOut.dragmode = 'pan';
3435
}

0 commit comments

Comments
 (0)