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

Method constructor

src/maplibregl/mapping/WebMap.js:77–91  ·  view source on GitHub ↗
(id, options, mapOptions)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

getProj4Method · 0.95
_fireMethod · 0.45

Tested by

no test coverage detected