删除所有的图层 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,这个变量必须是全局变量,图层才可以被删除