From d0e6f9233235ee68eb74b350f15717173918cc69 Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Thu, 22 Nov 2018 15:20:58 +0800
Subject: [PATCH] update

---
 src/main/webapp/js/moralmap.js |   69 +++++++++++++---------------------
 1 files changed, 27 insertions(+), 42 deletions(-)

diff --git a/src/main/webapp/js/moralmap.js b/src/main/webapp/js/moralmap.js
index 921e354..bc42550 100644
--- a/src/main/webapp/js/moralmap.js
+++ b/src/main/webapp/js/moralmap.js
@@ -550,7 +550,6 @@
 	//new BMap.Marker()������������IE7���������������������
 	moralMap.MoralMarker.prototype = new BMap.Marker();
 	//��������������� ������Mark������
-	var showMonitorpointInfoWindow = null;
 	moralMap.Monitorpoint = function(option) {
 		var icon = {};
 		icon["stateIcons"] = ["/img/ico00.png", "/img/ico01.png", "/img/ico02.png", "/img/ico03.png", "/img/ico04.png"];
@@ -600,9 +599,6 @@
 			}
 			return new BMap.InfoWindow(getAdressOutHtml(), winOpts);
 		})();
-		if (!showMonitorpointInfoWindow) {
-			showMonitorpointInfoWindow = infoWindow;
-		}
 		if(moralMarker["infoWindow"] == undefined) {
 			moralMarker["infoWindow"] = infoWindow;
 		}
@@ -642,7 +638,6 @@
 	}
 	//���������mac���key������
 	//��������������� ������MoralMark������
-	var showEquipmentInfoWindow = null;
 	moralMap.Equipment = function(option) {
 		var icon = {};
 		icon["stateIcons"] = ["/img/ico_coo00.png", "/img/ico_coo01.png", "/img/ico_coo02.png", "/img/ico_coo03.png", "/img/ico_coo04.png"];
@@ -697,10 +692,7 @@
 			}
 			return new BMap.InfoWindow(getAdressOutHtml(), winOpts);
 		})();
-		if (!showEquipmentInfoWindow) {
-			showEquipmentInfoWindow = infoWindow;
-		}
-		
+
 		/*var infoWindow = (function() {
 			//���������������
 			var winOpts = {
@@ -964,39 +956,32 @@
 	}
 
     moralMap.callJS = function(condition) {
-		var condition = JSON.parse(condition);
-		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;
-		} 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) {
-                	
-                }
-            });*/
-		}
+    	//$("#searchParam").val(condition);
+    	//var condition = JSON.parse(condition);
+    	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);
+    		if(moralMap.getMpoint(condition.id)){
+    			moralMap.openInfoWindow(moralMap.getMpoint(condition.id)["infoWindow"], new_point);
+    		}else {
+    			//$("#searchParam").val(condition.id);
+    		}
+    	} else if (condition.type == "device") {
+    		//baiduMap.centerAndZoom(new_point, 18);
+    		baiduMap.setZoom(18);
+    		if(moralMap.getEquipment(condition.mac)){
+    			moralMap.openInfoWindow(moralMap.getEquipment(condition.mac)["infoWindow"], new_point);
+    		} else {
+    			//var equipment = new moralMap.Equipment(condition);
+    			//moralMap.openInfoWindow(showInfoWindow, new_point);
+    			//moralMap.openInfoWindow(equipment["infoWindow"], new_point);
+    			//moralMap.openInfoWindow(moralMap.getEquipment(condition.mac)["infoWindow"], new_point);
+    			//moralMap.callJS(condition);
+    		}
+    	}
 	}
 
 

--
Gitblit v1.8.0