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

Function createWebMapV3Extending

src/common/mapping/WebMapV3.js:163–1497  ·  view source on GitHub ↗
(SuperClass, { MapManager, mapRepo, crsManager, l7LayerUtil })

Source from the content-addressed store, hash-verified

161 STYLE: 'style'
162};
163export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsManager, l7LayerUtil }) {
164 return class WebMapV3 extends SuperClass {
165 constructor(mapId, options, mapOptions = {}) {
166 super();
167 this.mapId = mapId;
168 this.options = options;
169 this.mapOptions = mapOptions;
170 this._mapResourceInfo = {};
171 this._relatedInfo = options.relatedInfo || {};
172 this._sprite = '';
173 this._spriteDatas = {};
174 this._appendLayers = false;
175 this._baseProjection = '';
176 }
177
178 initializeMap(mapInfo, map) {
179 this._mapInfo = mapInfo;
180 this._baseProjection = this._registerMapCRS(mapInfo);
181 if (map) {
182 this.map = map;
183 if (!crsManager.isSameProjection(this.map, this._baseProjection)) {
184 this.fire('projectionnotmatch');
185 return;
186 }
187 this._appendLayers = true;
188 // 处理图层管理添加 sprite
189 const sprite = this._mapInfo.sprite;
190 if (sprite) {
191 this._sprite = sprite;
192 this.map.addStyle({
193 sprite
194 });
195 }
196 this._initLayers();
197 return;
198 }
199 this._createMap();
200 }
201
202 cleanLayers(layers) {
203 super.cleanLayers(layers);
204 const l7MarkerLayers = l7LayerUtil.getL7MarkerLayers();
205 for (const layerId in l7MarkerLayers) {
206 l7LayerUtil.removeL7MarkerLayer(layerId, this.map.$l7scene);
207 }
208 }
209
210 clean(removeMap = true) {
211 if (this.map) {
212 if (this._sourceListModel) {
213 this._sourceListModel.destroy();
214 this._sourceListModel = null;
215 }
216 if (removeMap) {
217 const scene = this.map.$l7scene;
218 scene && scene.removeAllLayer();
219 this.map.remove();
220 }

Callers 4

WebMapV3Spec.jsFile · 0.90
WebMapV3Spec.jsFile · 0.90
_createWebMapFactoryMethod · 0.90
_createWebMapFactoryMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected