linqilong 1 mês atrás
pai
commit
730c9cb793
1 arquivos alterados com 29 adições e 2 exclusões
  1. 29 2
      src/utils/tdInstruction/layer.ts

+ 29 - 2
src/utils/tdInstruction/layer.ts

@@ -83,6 +83,25 @@ function addWindField(type: string, time: string) {
   Bus.emit('emitUIInteraction', descriptor);
   console.log("-- 添加 WindField 图层:", JSON.stringify(descriptor));
   windFieldState = true
+
+  windy(time)
+  windyIndex++
+  debugger
+}
+
+let windyIndex = 0
+
+function windy(time: string, show = true) {
+  let descriptor: any = {
+    "command": "Windy",
+    "data": {
+      "Time": time,
+      "Display": show ? "true" : "false"
+    }
+  }
+
+  Bus.emit('emitUIInteraction', descriptor);
+  console.log("-- 添加 windy 图层:", JSON.stringify(descriptor));
 }
 
 function updateWindField(type: string, time: string) {
@@ -97,6 +116,11 @@ function updateWindField(type: string, time: string) {
   getMaxMinValve(descriptor, type)
   Bus.emit('emitUIInteraction', descriptor);
   console.log("-- 更新 WindField 图层:", JSON.stringify(descriptor));
+
+  if (windyIndex % 5 === 0) {
+    windy(time)
+  }
+  windyIndex++
 }
 
 function getMaxMinValve(descriptor: any, type: string) {
@@ -128,7 +152,10 @@ export function closeTaihuForecast() {
       "type": "3"
     }
   }
-  Bus.emit('emitUIInteraction', descriptor)
+  Bus.emit('emitUIInteraction', descriptor);
   console.log("-- 删除 WindField 图层:", JSON.stringify(descriptor));
-  windFieldState = false
+  windFieldState = false;
+
+  windy('', false)
+  windyIndex = 0
 }