From c398d5256db186bd280156fa63d62e13a3baa8d1 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Wed, 14 Nov 2018 15:48:58 +0800 Subject: [PATCH] update --- src/main/webapp/js/moralmap.js | 61 +++++++++++++++++------------- 1 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/main/webapp/js/moralmap.js b/src/main/webapp/js/moralmap.js index 921e354..1e927e5 100644 --- a/src/main/webapp/js/moralmap.js +++ b/src/main/webapp/js/moralmap.js @@ -968,35 +968,42 @@ var new_point = new BMap.Point(condition.longitude, condition.latitude); baiduMap.panTo(new_point); baiduMap.setCenter(new_point); - if (condition.type == "mpoint") { - baiduMap.setZoom(17); - new moralMap.Monitorpoint(condition); - moralMap.openInfoWindow(showMonitorpointInfoWindow, new_point); - showMonitorpointInfoWindow = null; + var parma={}; + parma["areaCode"] = moralMap['params']["areaCode"]; + parma["orgId"] = moralMap['params']["orgId"]; + if (condition.type == "mpoint") { + parma["layer"] = "monitorpoints"; + parma["markerKeys"] = [condition.id]; } else if (condition.type == "device") { - var parma={}; - parma["layer"] = "equipments"; - parma["markerKeys"] = [condition.mac]; - parma["areaCode"] = moralMap['params']["areaCode"]; - parma["orgId"] = moralMap['params']["orgId"]; - baiduMap.setZoom(18); - //condition.data = {}; - new moralMap.Equipment(condition); - moralMap.openInfoWindow(showEquipmentInfoWindow, new_point); - showEquipmentInfoWindow = null; - /*$.ajax({ - type: "post", - url: "get-real-state-data", - data:JSON.stringify(parma), - dataType:"json", - contentType:"application/json;charset=utf-8", - cache: false, - async: true, - success: function(data) { - - } - });*/ + parma["layer"] = "equipments"; + parma["markerKeys"] = [condition.mac]; } + //$("#searchParam").val(JSON.stringify(parma)); + return; + $.ajax({ + type : "post", + url : "get-real-state-data", + data : JSON.stringify(parma), + dataType : "json", + contentType : "application/json;charset=utf-8", + cache : false, + async : true, + success : function(data) { + condition.state = data["extData"]["markers"][0]["state"]; + if (condition.type == "mpoint") { + baiduMap.setZoom(17); + new moralMap.Monitorpoint(condition); + moralMap.openInfoWindow(showMonitorpointInfoWindow, new_point); + showMonitorpointInfoWindow = null; + } else if (condition.type == "device") { + baiduMap.setZoom(18); + new moralMap.Equipment(condition); + moralMap.openInfoWindow(showEquipmentInfoWindow, new_point); + showEquipmentInfoWindow = null; + } + } + }); + } -- Gitblit v1.8.0