Skip to content

Commit fcb8c25

Browse files
committed
add 'some' mapbox-gl css rule
... mostly to hide mapbox-gl's own no-css warning that get injected into the DOM.
1 parent ae9cba8 commit fcb8c25

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/plots/mapbox/constants.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,11 @@ module.exports = {
3232
'More info here: https://www.mapbox.com/help/define-access-token/'
3333
].join('\n'),
3434

35-
mapOnErrorMsg: 'Mapbox error.'
35+
mapOnErrorMsg: 'Mapbox error.',
36+
37+
// a subset of node_modules/mapbox-gl/dist/mapbox-gl.css
38+
styleRules: {
39+
map: 'overflow:hidden;position:relative;',
40+
'missing-css': 'display:none',
41+
}
3642
};

src/plots/mapbox/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
109
'use strict';
1110

1211
var mapboxgl = require('mapbox-gl');
@@ -20,6 +19,9 @@ var constants = require('./constants');
2019

2120
var MAPBOX = 'mapbox';
2221

22+
for(var k in constants.styleRules) {
23+
Lib.addStyleRule('.mapboxgl-' + k, constants.styleRules[k]);
24+
}
2325

2426
exports.name = MAPBOX;
2527

0 commit comments

Comments
 (0)