Skip to content

Commit d071137

Browse files
committed
2 parents 538c289 + 7d65a8e commit d071137

File tree

5 files changed

+818
-820
lines changed

5 files changed

+818
-820
lines changed

src/mapboxgl/mapping/WebMap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ export class WebMap extends mapboxgl.Evented {
205205
zoomBase = 0;
206206
// zoom = zoom === 0 ? 0 : zoom - 1;
207207
if (mapInfo.minScale && mapInfo.maxScale) {
208-
zoomBase = this._transformScaleToZoom(mapInfo.minScale, mapboxgl.CRS.get(this.baseProjection));
208+
zoomBase = this._transformScaleToZoom(mapInfo.minScale, mapboxgl.CRS ? mapboxgl.CRS.get(this.baseProjection):'EPSG:3857');
209209
} else {
210210
zoomBase = +Math.log2(
211-
this._getResolution(mapboxgl.CRS.get(this.baseProjection).getExtent()) / this._getResolution(mapInfo.extent)
211+
this._getResolution(mapboxgl.CRS ? mapboxgl.CRS.get(this.baseProjection).getExtent():[-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]) / this._getResolution(mapInfo.extent)
212212
).toFixed(2);
213213
}
214214
zoom += zoomBase;

0 commit comments

Comments
 (0)