jinpengyong
2020-09-28 9b9f6e309a0b0ffd5c2495eaf8438b36704991a6
src/main/webapp/view/newmap.jsp
@@ -709,11 +709,12 @@
                /*  if (moralMap.showSensors && typeof (moralMap.showSensors) == "function") {
                      moralMap.showSensors(JSON.parse(JSON.parse(msg.data)));
                  }*/
                if ($("#close").html() == "CloseMq") {
                    ws.close();
                }
                moralMap.showSensors(JSON.parse(JSON.parse(msg.data)));
            };
            if ($("#close").html()=="CloseMq") {
                ws.close();
            }
            //关闭事件
            ws.onclose = function () {
                $("#close").html("websocket已经关闭");
@@ -722,7 +723,6 @@
            ws.onerror = function () {
                $("#close").html("websocket关闭错误");
            };
        }
    })(jQuery);
@@ -839,14 +839,9 @@
        } 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) {
            //window.location = "http://www.baidu.com"
            $("#close").html(methodName);
        }
    }
</script>