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

Method cleanLayers

src/common/mapping/WebMapBase.js:489–498  ·  view source on GitHub ↗

* @version 11.2.1 * @function WebMapBase.prototype.cleanLayers * @description 删除追加的图层和事件。当设置 `map` 时有效

()

Source from the content-addressed store, hash-verified

487 * @description 删除追加的图层和事件。当设置 `map` 时有效
488 */
489 cleanLayers() {
490 // 清空追加的地图图层以及对应的事件
491 if (!this.map) {
492 return;
493 }
494 const layersToClean = this._cacheCleanLayers.filter((item) => !item.reused);
495 this._handler && this._handler.cleanLayers(layersToClean);
496 this._cacheCleanLayers = [];
497 this.clean(false);
498 }
499
500 /**
501 * @version 12.0.1

Callers 1

setStyleMethod · 0.95

Calls 2

cleanMethod · 0.95
filterMethod · 0.80

Tested by

no test coverage detected