(id, options, mapOptions)
| 75 | */ |
| 76 | export 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 |
nothing calls this directly
no test coverage detected