刪除所有的圖層 this.viewer.imageryLayers.removeAll()
刪除單個圖層 this.viewer.imageryLayers.remove(變量名)
變量名是你在往地球上添加圖層時定義的,如:
this.zoning = this.viewer.imageryLayers.addImageryProvider(
new this.Cesium.WebMapServiceImageryProvider({
url: URL,
maximumLevel: 8,
layers: '',
credit: 'Black Marble imagery courtesy NASA Earth Observatory'
})
)
this.zoning.alpha = 0.1 //圖層的透明度
this.zoning.brightness = 5.0 //圖層的亮度
其中zoning是在data中定義的 , 這里不能用 var zoning,這個變量必須是全局變量,圖層才可以被刪除