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

Method remove

src/mapboxgl/overlay/theme/Theme3DLayer.js:234–256  ·  view source on GitHub ↗

* @function Theme3DLayer.prototype.remove * @description 从地图上移除图层。 * @returns {Theme3DLayer} Theme3DLayer的实例对象。

()

Source from the content-addressed store, hash-verified

232 * @returns {Theme3DLayer} Theme3DLayer的实例对象。
233 */
234 remove() {
235 if (!this.map) {
236 return this;
237 }
238 //移除图层
239 var layerId = this.id ? this.id : "theme3DLayer";
240 if (this.map.getLayer(layerId)) {
241 this.map.off('mousemove', layerId, this._onMouseMove.bind(this));
242 this.map.on('mouseout', layerId, this._onMouseMove.bind(this));
243 this.map.removeLayer(layerId);
244 }
245 //移除高亮图层
246 if (this.map.getLayer(this._highlightLayerId)) {
247 this._selectFeatureId = null;
248 this.map.removeLayer(this._highlightLayerId );
249 }
250
251 //移除图例
252 if (this.legend) {
253 this.map.removeControl(this.legend);
254 }
255 return this;
256 }
257
258 /**
259 * @function Theme3DLayer.prototype.getLayerStyleOptions

Callers

nothing calls this directly

Calls 5

bindMethod · 0.80
getLayerMethod · 0.45
offMethod · 0.45
onMethod · 0.45
removeLayerMethod · 0.45

Tested by

no test coverage detected