* @version 11.2.1 * @function WebMapBase.prototype.clean * @description 删除地图或者清空地图上的图层和事件。 * @param {boolean} [removeMap=true] - 是否删除地图。false 表示只清空地图上的图层和事件。
(removeMap = true)
| 467 | * @param {boolean} [removeMap=true] - 是否删除地图。false 表示只清空地图上的图层和事件。 |
| 468 | */ |
| 469 | clean(removeMap = true) { |
| 470 | if (this.map) { |
| 471 | removeMap && this._fire('mapbeforeremove', { map: this.map }); |
| 472 | if (this._handler) { |
| 473 | this._handler.clean(removeMap); |
| 474 | this._handler = null; |
| 475 | } |
| 476 | removeMap && (this.map = null); |
| 477 | if (this.mapOptions && (this.mapId || this.webMapInfo)) { |
| 478 | this.mapOptions.center = null; |
| 479 | this.mapOptions.zoom = null; |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | /** |
| 485 | * @version 11.2.1 |
no test coverage detected