* @function Theme3DLayer.prototype.remove * @description 从地图上移除图层。 * @returns {Theme3DLayer} Theme3DLayer的实例对象。
()
| 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 |
nothing calls this directly
no test coverage detected