From 7df1aad3d9f2e54d8549bb0e55b8b6a3f1ae90ff Mon Sep 17 00:00:00 2001
From: xufenglei <xufenglei>
Date: Fri, 09 Nov 2018 16:57:49 +0800
Subject: [PATCH] update
---
src/main/webapp/js/moralmap.js | 62 ++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 17 deletions(-)
diff --git a/src/main/webapp/js/moralmap.js b/src/main/webapp/js/moralmap.js
index f65701f..f097d2b 100644
--- a/src/main/webapp/js/moralmap.js
+++ b/src/main/webapp/js/moralmap.js
@@ -550,13 +550,14 @@
//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"];
icon["width"] = 50;
icon["height"] = 50;
option["icon"] = icon;
- var moralMask = new moralMap.MoralMarker(option);
+ var moralMarker = new moralMap.MoralMarker(option);
// var mark =new BMap.Marker(pointObj,{icon:iconObj});
//==================infoWindow-start============================
var infoWindow = (function() {
@@ -593,26 +594,29 @@
adressOutHtml += "<tbody><tr><td style='vertical-align:top;width:38px;white-space:nowrap;word-break:keep-all'>��������� </td><td style='line-height:16px'>";
adressOutHtml += address + " ";
adressOutHtml += "</td></tr>";
- adressOutHtml += "<tr><td style='width:98%;padding-top:10px;'colspan='2'><a href='javascript:void(0);' style='display:block;position: relative;float: right;' onclick='moralMap.showPointMonitor("+option.id+")'>������������>></a></td></tr>";
+ //adressOutHtml += "<tr><td style='width:98%;padding-top:10px;'colspan='2'><a href='javascript:void(0);' style='display:block;position: relative;float: right;' onclick='moralMap.showPointMonitor("+option.id+")'>������������>></a></td></tr>";
adressOutHtml += "</tbody></table></div>";
return adressOutHtml;
}
return new BMap.InfoWindow(getAdressOutHtml(), winOpts);
})();
- if(moralMask["infoWindow"] == undefined) {
- moralMask["infoWindow"] = infoWindow;
+ if (!showMonitorpointInfoWindow) {
+ showMonitorpointInfoWindow = infoWindow;
+ }
+ if(moralMarker["infoWindow"] == undefined) {
+ moralMarker["infoWindow"] = infoWindow;
}
//���������������������
- moralMask.addEventListener("mouseover", function() {
+ moralMarker.addEventListener("mouseover", function() {
moralMap.openInfoWindow(infoWindow, this._point); //������������������
});
- moralMask.addEventListener("mouseout", function() {
+ moralMarker.addEventListener("mouseout", function() {
moralMap.closeInfoWindow();
});
//==================infoWindow-end============================
//���������������
- moralMap.putMpoint(option['id'], moralMask);
- return moralMask;
+ moralMap.putMpoint(option['id'], moralMarker);
+ return moralMarker;
}
//������MonitorPoint������
moralMap.putMpoint = function(key, obj) {
@@ -638,6 +642,7 @@
}
//���������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"];
@@ -648,7 +653,7 @@
option["offline_height"] = 80;
option["online_width"] = 355;
option["online_height"] = 385;
- var moralMask = new moralMap.MoralMarker(option);
+ var moralMarker = new moralMap.MoralMarker(option);
// var mark =new BMap.Marker(pointObj,{icon:iconObj});
//==================infoWindow-start============================
var infoWindow = (function() {
@@ -674,6 +679,9 @@
}
return new BMap.InfoWindow("", winOpts);
})();
+ if (!showEquipmentInfoWindow) {
+ showEquipmentInfoWindow = infoWindow;
+ }
var dataHandle = {
_getDataOutHtml: function(data) {
if(data==null||data["state"]==4){
@@ -727,12 +735,12 @@
}
};
- if(moralMask["infoWindow"] == undefined) {
- moralMask["infoWindow"] = infoWindow;
+ if(moralMarker["infoWindow"] == undefined) {
+ moralMarker["infoWindow"] = infoWindow;
}
var mouseOverHandle = option['mouseover'];
//���������������������
- moralMask.addEventListener("mouseover", function() {
+ moralMarker.addEventListener("mouseover", function() {
if(mouseOverHandle!=null&&mouseOverHandle instanceof Function){
//���arguments���������������
var args = Array.prototype.slice.call(arguments);
@@ -754,16 +762,16 @@
infoWindow.redraw();
}
});
- moralMask.addEventListener("mouseout", function() {
+ moralMarker.addEventListener("mouseout", function() {
baiduMap.closeInfoWindow();
infoWindow.setContent("");
moralMap.openSearchBox();
});
//==================infoWindow-end============================
//���������������
- moralMap.putEquipment(option['mac'], moralMask);
- var _super_refreshState = moralMask.refreshState;
- return $.extend(moralMask, {
+ moralMap.putEquipment(option['mac'], moralMarker);
+ var _super_refreshState = moralMarker.refreshState;
+ return $.extend(moralMarker, {
refreshState: function(data) {
if(data != null && data!="") {
var state = this.getOption()["state"];
@@ -902,6 +910,26 @@
}
}
- }
+ }
+
+ 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") {
+ baiduMap.setZoom(18);
+ new moralMap.Equipment(condition);
+ moralMap.openInfoWindow(showEquipmentInfoWindow, new_point);
+ showEquipmentInfoWindow = null;
+ }
+ }
+
+
window.moralMap = moralMap;
})(jQuery, BMap, window);
\ No newline at end of file
--
Gitblit v1.8.0