File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 99
1010'use strict' ;
1111
12+ var requiredVersion = '0.44.0' ;
1213
1314module . exports = {
15+ requiredVersion : requiredVersion ,
16+
1417 styleUrlPrefix : 'mapbox://styles/mapbox/' ,
1518 styleUrlSuffix : 'v9' ,
1619
1720 controlContainerClassName : 'mapboxgl-control-container' ,
1821
22+ wrongVersionErrorMsg : [
23+ 'Your custom plotly.js bundle is not using the correct mapbox-gl version' ,
24+ 'Please install mapbox-gl@' + requiredVersion + '.'
25+ ] . join ( '\n' ) ,
26+
1927 noAccessTokenErrorMsg : [
2028 'Missing Mapbox access token.' ,
2129 'Mapbox trace type require a Mapbox access token to be registered.' ,
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ exports.plot = function plotMapbox(gd) {
5353 var calcData = gd . calcdata ;
5454 var mapboxIds = fullLayout . _subplots [ MAPBOX ] ;
5555
56+ if ( mapboxgl . version !== constants . requiredVersion ) {
57+ throw new Error ( constants . wrongVersionErrorMsg ) ;
58+ }
59+
5660 var accessToken = findAccessToken ( gd , mapboxIds ) ;
5761 mapboxgl . accessToken = accessToken ;
5862
You can’t perform that action at this time.
0 commit comments