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