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

Method clean

src/common/mapping/WebMapBase.js:469–482  ·  view source on GitHub ↗

* @version 11.2.1 * @function WebMapBase.prototype.clean * @description 删除地图或者清空地图上的图层和事件。 * @param {boolean} [removeMap=true] - 是否删除地图。false 表示只清空地图上的图层和事件。

(removeMap = true)

Source from the content-addressed store, hash-verified

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

Callers 2

cleanLayersMethod · 0.95
_initWebMapMethod · 0.95

Calls 1

_fireMethod · 0.95

Tested by

no test coverage detected