MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / constructor

Method constructor

src/mapboxgl/mapping/WebMap.js:78–92  ·  view source on GitHub ↗
(id, options, mapOptions)

Source from the content-addressed store, hash-verified

76 */
77export class WebMap extends createWebMapBaseExtending(mapboxgl.Evented, { mapRepo: mapboxgl }) {
78 constructor(id, options, mapOptions) {
79 const crsManager = new CRSManager(options && options.proj4);
80 const proj4 = crsManager.getProj4();
81 super(id, { ...options, proj4 }, mapOptions);
82 this._crsManager = crsManager;
83 if (!mapboxgl.CRS) {
84 const error =
85 'WebMap needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362';
86 Promise.resolve().then(() => {
87 this._fire('mapcreatefailed', { error: error });
88 });
89 } else {
90 this._readyForInitializingWebMap();
91 }
92 }
93
94 /**
95 * @function WebMap.prototype.setCRS

Callers

nothing calls this directly

Calls 3

getProj4Method · 0.95
_fireMethod · 0.45

Tested by

no test coverage detected