* @version 11.2.1 * @function WebMapBase.prototype.cleanLayers * @description 删除追加的图层和事件。当设置 `map` 时有效
()
| 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 |