You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mapboxgl/mapping/webmap/v3/WebMap.js
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,10 @@ export class WebMap extends mapboxgl.Evented {
112
112
initializeMap(mapInfo,map){
113
113
mapInfo=this._handleUnSupportedLayers(mapInfo);
114
114
this._mapInfo=mapInfo;
115
+
constproj=this._setBaseProjection();
116
+
if(!proj){
117
+
return;
118
+
}
115
119
if(map){
116
120
this._appendLayers=true;
117
121
this.map=map;
@@ -145,7 +149,6 @@ export class WebMap extends mapboxgl.Evented {
145
149
_createMap(){
146
150
let{
147
151
name ='',
148
-
crs,
149
152
center =newmapboxgl.LngLat(0,0),
150
153
zoom =0,
151
154
bearing =0,
@@ -154,18 +157,6 @@ export class WebMap extends mapboxgl.Evented {
154
157
maxzoom,
155
158
sprite =''
156
159
}=this._mapInfo;
157
-
letbaseProjection=crs;
158
-
if(typeofcrs==='object'){
159
-
baseProjection=crs.name;
160
-
if(!mapboxgl.CRS){
161
-
consterror=`The EPSG code ${baseProjection} needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362`;
162
-
this.fire('getmapinfofailed',{error: error});
163
-
console.error(error);
164
-
return;
165
-
}
166
-
this._setCRS(crs);
167
-
}
168
-
this._baseProjection=baseProjection;
169
160
center=this.mapOptions.center||center;
170
161
zoom=this.mapOptions.zoom||zoom;
171
162
bearing=this.mapOptions.bearing||bearing;
@@ -199,6 +190,23 @@ export class WebMap extends mapboxgl.Evented {
199
190
});
200
191
}
201
192
193
+
_setBaseProjection(){
194
+
letcrs=this._mapInfo.crs;
195
+
letbaseProjection=crs;
196
+
if(typeofcrs==='object'){
197
+
baseProjection=crs.name;
198
+
if(!mapboxgl.CRS){
199
+
consterror=`The EPSG code ${baseProjection} needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362`;
0 commit comments