Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d2fe7f4

Browse files
committed
clear navigation container on map creation:
- so that links to open-street map don't show.
1 parent d99bfd5 commit d2fe7f4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/plots/mapbox/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414
styleUrlPrefix: 'mapbox://styles/mapbox/',
1515
styleUrlSuffix: 'v9',
1616

17+
controlContainerClassName: 'mapboxgl-control-container',
18+
1719
noAccessTokenErrorMsg: [
1820
'Missing Mapbox access token.',
1921
'Mapbox trace type require a Mapbox access token to be registered.',

src/plots/mapbox/mapbox.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
9595
preserveDrawingBuffer: self.isStatic
9696
});
9797

98+
// clear navigation container
99+
var controlContainer = this.div.getElementsByClassName(constants.controlContainerClassName)[0];
100+
this.div.removeChild(controlContainer);
101+
98102
self.rejectOnError(reject);
99103

100104
map.once('load', function() {

0 commit comments

Comments
 (0)