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 9
9
10
10
'use strict' ;
11
11
12
+ var requiredVersion = '0.44.0' ;
12
13
13
14
module . exports = {
15
+ requiredVersion : requiredVersion ,
16
+
14
17
styleUrlPrefix : 'mapbox://styles/mapbox/' ,
15
18
styleUrlSuffix : 'v9' ,
16
19
17
20
controlContainerClassName : 'mapboxgl-control-container' ,
18
21
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
+
19
27
noAccessTokenErrorMsg : [
20
28
'Missing Mapbox access token.' ,
21
29
'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) {
53
53
var calcData = gd . calcdata ;
54
54
var mapboxIds = fullLayout . _subplots [ MAPBOX ] ;
55
55
56
+ if ( mapboxgl . version !== constants . requiredVersion ) {
57
+ throw new Error ( constants . wrongVersionErrorMsg ) ;
58
+ }
59
+
56
60
var accessToken = findAccessToken ( gd , mapboxIds ) ;
57
61
mapboxgl . accessToken = accessToken ;
58
62
You can’t perform that action at this time.
0 commit comments