From 121a5b01a2461b5d9d5c188f9dd36c2e4673db9d Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Mon, 28 Sep 2020 10:41:08 +0800
Subject: [PATCH] 实时风向与因子数据从同一个websokceket获取优化

---
 src/main/webapp/view/newmap.jsp |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/view/newmap.jsp b/src/main/webapp/view/newmap.jsp
index d411bc4..0648bcc 100644
--- a/src/main/webapp/view/newmap.jsp
+++ b/src/main/webapp/view/newmap.jsp
@@ -710,8 +710,9 @@
                       moralMap.showSensors(JSON.parse(JSON.parse(msg.data)));
                   }*/
                 if ($("#close").html() == "CloseMq") {
-                    ws.close();
+                    ws.close(JSON.parse(msg.data));
                 }
+                moralMap.showSensors(JSON.parse(JSON.parse(msg.data)));
             };
 
             //������������
@@ -722,7 +723,6 @@
             ws.onerror = function () {
                 $("#close").html("websocket������������");
             };
-
         }
 
     })(jQuery);
@@ -839,9 +839,6 @@
         } else if ("RefreshState" == methodName) {
             var states = jsonData.states;
             moralMap.refreshState(states);
-        } else if ("DeliverSensors" == methodName) {
-            $("#close").html(methodName);
-            moralMap.showSensors(jsonData);
         } else if ("CloseMq" == methodName) {
             $("#close").html(methodName);
         }

--
Gitblit v1.8.0