| | |
| | | if (typeof (WebSocket) === "undefined") { |
| | | alert("您的浏览器不支持WebSocket"); |
| | | } else { |
| | | ws = new WebSocket('ws://' + hostAndPort + '/screen/webSocket/' + orgId + '&' + accountId); |
| | | ws = new WebSocket('ws://' + hostAndPort + '/screen/webSocket/' + orgId + '&' + accountId+'_'+regionCode); |
| | | ws.onopen = function () { |
| | | }; |
| | | |
| | |
| | | ws.onmessage = function (msg) { |
| | | // $("#searchParam").val(JSON.parse(msg.data)); |
| | | moralMap.refreshWindDir(JSON.parse(JSON.parse(msg.data))); |
| | | if (moralMap.showSensors && typeof (moralMap.showSensors) == "function") { |
| | | /* if (moralMap.showSensors && typeof (moralMap.showSensors) == "function") { |
| | | moralMap.showSensors(JSON.parse(JSON.parse(msg.data))); |
| | | } |
| | | }*/ |
| | | }; |
| | | |
| | | //关闭事件 |
| | |
| | | var states = jsonData.states; |
| | | moralMap.refreshState(states); |
| | | } else if ("DeliverSensors" == methodName) { |
| | | // moralMap.showSensors(jsonData); |
| | | moralMap.showSensors(jsonData); |
| | | } |
| | | } |
| | | </script> |