MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / _initLayers

Method _initLayers

src/common/mapping/WebMapV3.js:397–427  ·  view source on GitHub ↗

* @private * @function WebMapV3.prototype._initLayers * @description emit 图层加载成功事件。

()

Source from the content-addressed store, hash-verified

395 * @description emit 图层加载成功事件。
396 */
397 async _initLayers() {
398 await this._getSpriteDatas();
399 if (Object.prototype.toString.call(this.mapId) === '[object Object]') {
400 this.mapParams = {
401 title: this._mapInfo.name,
402 description: this._relatedInfo.description
403 };
404 if (this._relatedInfo.projectInfo) {
405 this._mapResourceInfo = JSON.parse(this._relatedInfo.projectInfo);
406 this._changeMapInfoFilter();
407 }
408 this._createMapRelatedInfo();
409 this._addLayersToMap();
410 return;
411 }
412 this._getMapRelatedInfo()
413 .then((relatedInfo) => {
414 this.mapParams = {
415 title: this._mapInfo.name,
416 description: relatedInfo.description
417 };
418 this._mapResourceInfo = JSON.parse(relatedInfo.projectInfo);
419 this._changeMapInfoFilter();
420 this._createMapRelatedInfo();
421 this._addLayersToMap();
422 })
423 .catch((error) => {
424 this.fire('mapcreatefailed', { error: error });
425 console.error(error);
426 });
427 }
428 /**
429 * @private
430 * @function WebMapV3.prototype._changeMapInfoFilter

Callers 2

initializeMapMethod · 0.95
_createMapMethod · 0.95

Calls 7

_getSpriteDatasMethod · 0.95
_changeMapInfoFilterMethod · 0.95
_createMapRelatedInfoMethod · 0.95
_addLayersToMapMethod · 0.95
_getMapRelatedInfoMethod · 0.95
parseMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected