| | |
| | | } |
| | | </style> |
| | | <body> |
| | | <div> |
| | | </div> |
| | | <textarea id="close" hidden></textarea> |
| | | |
| | | <div class="main_body"> |
| | | <%--<input id="button" type="button" value="点击" onclick="getJs();">--%> |
| | | <div class="tools_box"> |
| | | <div class="charts_btn"> |
| | | </div> |
| | |
| | | alert(equStr); |
| | | } |
| | | } |
| | | if("国控站"===obj["monitorPoint"]["description"]){ |
| | | if ("国控站" === obj["monitorPoint"]["description"]) { |
| | | var icon05 = new BMap.Icon("/img/ico05.png", new BMap.Size(50, 50)); |
| | | var mark05 = new BMap.Marker(new BMap.Point(obj["monitorPoint"]["longitude"], obj["monitorPoint"]["latitude"]), {icon: icon05}); |
| | | moralMap.addOverlay(mark05); |
| | | }else if("省控站"===obj["monitorPoint"]["description"]){ |
| | | } else if ("省控站" === obj["monitorPoint"]["description"]) { |
| | | var icon06 = new BMap.Icon("/img/ico06.png", new BMap.Size(50, 50)); |
| | | var mark06 = new BMap.Marker(new BMap.Point(obj["monitorPoint"]["longitude"], obj["monitorPoint"]["latitude"]), {icon: icon06}); |
| | | moralMap.addOverlay(mark06); |
| | | }else if("县控站"===obj["monitorPoint"]["description"]){ |
| | | } else if ("县控站" === obj["monitorPoint"]["description"]) { |
| | | var icon08 = new BMap.Icon("/img/ico08.png", new BMap.Size(50, 50)); |
| | | var mark08 = new BMap.Marker(new BMap.Point(obj["monitorPoint"]["longitude"], obj["monitorPoint"]["latitude"]), {icon: icon08}); |
| | | moralMap.addOverlay(mark08); |
| | |
| | | ws = new WebSocket('ws://' + hostAndPort + '/screen/webSocket/' + orgId + '&' + accountId + '_' + regionCode); |
| | | ws.onopen = function () { |
| | | }; |
| | | |
| | | //获得消息事件 |
| | | ws.onmessage = function (msg) { |
| | | // $("#searchParam").val(JSON.parse(msg.data)); |
| | |
| | | }*/ |
| | | }; |
| | | |
| | | if ($("#close").html()=="CloseMq") { |
| | | ws.close(); |
| | | } |
| | | //关闭事件 |
| | | ws.onclose = function () { |
| | | $("#close").html("websocket已经关闭"); |
| | | }; |
| | | //发生了错误事件 |
| | | ws.onerror = function () { |
| | | $("#close").html("websocket关闭错误"); |
| | | }; |
| | | |
| | | } |
| | | |
| | | })(jQuery); |
| | |
| | | } |
| | | |
| | | function callJS(jsonData) { |
| | | $("#close").html(jsonData); |
| | | var jsonData = JSON.parse(jsonData); |
| | | var methodName = jsonData.methodName; |
| | | // $("#searchParam").val(JSON.stringify(jsonData)); |
| | |
| | | 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> |