|
|
@@ -83,6 +83,8 @@
|
|
|
ref="weatherView"
|
|
|
:basicGeoJson="basicGeoJson"
|
|
|
:showControl="showControl"
|
|
|
+ :modeType="controlMode"
|
|
|
+ :cesiumViewer="viewer"
|
|
|
@coverOnChange="coverOnChange"
|
|
|
@resetChangeWind="resetChangeWind"
|
|
|
@resetChangeStation="resetChangeStation"
|
|
|
@@ -244,6 +246,7 @@ export default {
|
|
|
controlMode: "",
|
|
|
cityWeather: {},
|
|
|
showControl: false,
|
|
|
+ adLayers: [],
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -292,25 +295,51 @@ export default {
|
|
|
this.showAllStation(this.viewer, showStation);
|
|
|
},
|
|
|
coverOnChange(val) {
|
|
|
- if(val.name === "回放") {
|
|
|
+ if (val.name === "回放") {
|
|
|
this.showControl = !this.showControl;
|
|
|
+ clearInterval(this.cloudintervalId);
|
|
|
+ clearInterval(this.rainintervalId);
|
|
|
+ clearInterval(this.tempintervalId);
|
|
|
+ this.cloudintervalId = null;
|
|
|
+ this.rainintervalId = null;
|
|
|
+ this.tempintervalId = null;
|
|
|
+ if (this.windLayer) {
|
|
|
+ this.removeWindLayer();
|
|
|
+ }
|
|
|
+ if (this.cloudLayer || this.cloudImagesLayer.length > 0) {
|
|
|
+ this.removeCloudLayer();
|
|
|
+ }
|
|
|
+ if (this.rainLayer || this.rainImagesLayer.length > 0) {
|
|
|
+ this.removeRainLayer();
|
|
|
+ }
|
|
|
+ if (this.temperatureLayer || this.tempImagesLayer.length > 0) {
|
|
|
+ this.removeTemperatureLayer();
|
|
|
+ }
|
|
|
} else if (val.name === "风场图") {
|
|
|
this.controlMode = this.controlMode === "wind" ? "" : "wind";
|
|
|
- this.switchWindLayer(val.check);
|
|
|
+ if (!this.showControl) {
|
|
|
+ this.switchWindLayer(val.check);
|
|
|
+ }
|
|
|
} else if (val.name === "云层图") {
|
|
|
this.controlMode = this.controlMode === "cloud" ? "" : "cloud";
|
|
|
- this.switchCloudLayer(val.check);
|
|
|
+ if (!this.showControl) {
|
|
|
+ this.switchCloudLayer(val.check);
|
|
|
+ }
|
|
|
} else if (val.name === "降雨图") {
|
|
|
this.controlMode = this.controlMode === "rain" ? "" : "rain";
|
|
|
- this.switchRainLayer(val.check);
|
|
|
+ if (!this.showControl) {
|
|
|
+ this.switchRainLayer(val.check);
|
|
|
+ }
|
|
|
} else if (val.name === "温度图") {
|
|
|
this.controlMode = this.controlMode === "temp" ? "" : "temp";
|
|
|
- this.switchTemperatureLayerr(val.check);
|
|
|
+ if (!this.showControl) {
|
|
|
+ this.switchTemperatureLayerr(val.check);
|
|
|
+ }
|
|
|
} else {
|
|
|
ElMessage({
|
|
|
- message: '暂无数据',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
+ message: "暂无数据",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
test() {
|
|
|
@@ -1086,7 +1115,6 @@ export default {
|
|
|
},
|
|
|
duration: 1.0,
|
|
|
complete() {
|
|
|
- // 为什么要加这个?因为破库地球没完全加载完成时如果执行了监听鼠标滑动事件会光速报错滑跪
|
|
|
if (!that.loadDone) {
|
|
|
that.initEventInputAction();
|
|
|
that.loadDone = true;
|
|
|
@@ -1271,6 +1299,10 @@ export default {
|
|
|
// 当前显示的图片索引
|
|
|
let currentImageIndex = -1; // 初始为-1,表示没有图片显示
|
|
|
|
|
|
+ this.adLayers?.forEach((ele) => {
|
|
|
+ this.viewer.imageryLayers.remove(ele);
|
|
|
+ });
|
|
|
+
|
|
|
// 创建所有图片图层并添加到Viewer,初始时全部隐藏
|
|
|
await imageUrls.forEach((url) => {
|
|
|
const provider = new Cesium.SingleTileImageryProvider({
|
|
|
@@ -1289,6 +1321,7 @@ export default {
|
|
|
imageLayers.push(Layer);
|
|
|
ImagesLayers.push(Layer);
|
|
|
});
|
|
|
+ this.adLayers = imageLayers;
|
|
|
function showNextImage() {
|
|
|
// 隐藏当前图片
|
|
|
if (currentImageIndex >= 0 && currentImageIndex < imageLayers.length) {
|
|
|
@@ -1305,8 +1338,8 @@ export default {
|
|
|
}
|
|
|
|
|
|
// 设置切换间隔(毫秒),例如每5秒切换一次
|
|
|
- const intervalMs = 5000;
|
|
|
- intervalId = setInterval(showNextImage, intervalMs);
|
|
|
+ // const intervalMs = 5000;
|
|
|
+ // intervalId = setInterval(showNextImage, intervalMs);
|
|
|
|
|
|
// 初始显示第一张图片
|
|
|
showNextImage();
|