From 850d0f291dc614c495685d1b82a145823b318201 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Wed, 14 Nov 2018 16:27:20 +0800 Subject: [PATCH] update --- src/main/webapp/js/moralmap.js | 52 +++++++++++++++------------------------------------- 1 files changed, 15 insertions(+), 37 deletions(-) diff --git a/src/main/webapp/js/moralmap.js b/src/main/webapp/js/moralmap.js index f5e33a1..5017183 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 = { @@ -782,7 +774,7 @@ } var mouseOverHandle = option['mouseover']; //��������������������� - moralMarker.addEventListener("mouseover", function() { + /*moralMarker.addEventListener("mouseover", function() { if(mouseOverHandle!=null&&mouseOverHandle instanceof Function){ //���arguments��������������� var args = Array.prototype.slice.call(arguments); @@ -790,7 +782,7 @@ } moralMap.closeSearchBox(); baiduMap.openInfoWindow(infoWindow, this._point); //������������������ - /*if(infoWindow.getContent() == "") { + if(infoWindow.getContent() == "") { var data = this.getData(); var option = this.getOption(); if(data==null||data["state"]==4){ @@ -802,13 +794,21 @@ } infoWindow.setContent(dataHandle._getDataOutHtml(data)); infoWindow.redraw(); - }*/ + } }); moralMarker.addEventListener("mouseout", function() { baiduMap.closeInfoWindow(); infoWindow.setContent(""); moralMap.openSearchBox(); + });*/ + + moralMarker.addEventListener("mouseover", function() { + moralMap.openInfoWindow(infoWindow, this._point); //������������������ }); + moralMarker.addEventListener("mouseout", function() { + moralMap.closeInfoWindow(); + }); + //==================infoWindow-end============================ //��������������� moralMap.putEquipment(option['mac'], moralMarker); @@ -960,34 +960,12 @@ var new_point = new BMap.Point(condition.longitude, condition.latitude); baiduMap.panTo(new_point); baiduMap.setCenter(new_point); - if (condition.type == "mpoint") { + if (condition.type == "mpoint") { baiduMap.setZoom(17); - new moralMap.Monitorpoint(condition); - moralMap.openInfoWindow(showMonitorpointInfoWindow, new_point); - showMonitorpointInfoWindow = null; + moralMap.openInfoWindow(moralMap.getMpoint(condition.id)["infoWindow"], new_point); } 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) { - - } - });*/ + moralMap.openInfoWindow(moralMap.getEquipment(condition.mac)["infoWindow"], new_point); } } -- Gitblit v1.8.0