|  |  |  | 
|---|
|  |  |  | 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))); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //关闭事件 | 
|---|
|  |  |  | 
|---|
|  |  |  | ws.onerror = function () { | 
|---|
|  |  |  | $("#close").html("websocket关闭错误"); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | })(jQuery); | 
|---|
|  |  |  | 
|---|
|  |  |  | } 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); | 
|---|
|  |  |  | } | 
|---|