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/view/map.jsp | 57 ++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/src/main/webapp/view/map.jsp b/src/main/webapp/view/map.jsp
index aaf60a6..a0eaf09 100644
--- a/src/main/webapp/view/map.jsp
+++ b/src/main/webapp/view/map.jsp
@@ -278,14 +278,14 @@
<div class="charts_btn">
</div>
</div>
- <div class="search_box">
+ <!-- <div class="search_box">
<button id="searchBtn" type="button">������</button>
<input id="searchParam"/>
- </div>
- <div id="popup_box">
+ </div> -->
+ <!-- <div id="popup_box">
<div id="equ_list" class="listview">
</div>
- </div>
+ </div> -->
<div id="mapCanvas"></div>
<div id="mapParams" style="display: none;">
${requestScope.mapParams}
@@ -316,7 +316,7 @@
var params = moralMap['params'];
var mpoint = obj.currentTarget.getOption();
- $("#searchParam").val(mpoint['name']);
+ //$("#searchParam").val(mpoint['name']);
var url = 'get-devices-by-mid-oid?mpId=' + mpoint['id'] + "&orgId=" + params['orgId'];
listView.load(url);
moralMap.showPopupbox("#popup_box");
@@ -395,7 +395,6 @@
}
var equStr = JSON.stringify(equ);
if(window["console"]!=undefined){
- console.log(equStr);
}
if(!!window['external']&&!!window['external']['callWin']){
window['external'].callWin(equStr);
@@ -447,10 +446,15 @@
//map���������������
// TODO ������
- function bs() {
+ function getBounds() {
var bs = moralMap.getBounds(); //������������������������������������
// var bssw = bs.getSouthWest(); //���������������������������(������������)
// var bsne = bs.getNorthEast(); //���������������������������(������������)
+ if(!getBounds.topLeftAnchor){
+ getBounds.topLeftAnchor = {};
+ getBounds.topLeftAnchor.x0 = bs.southwestLng;
+ getBounds.topLeftAnchor.y0 = bs.northeastLat;
+ }
return { 'x1': bs.southwestLng, 'y1': bs.southwestLat, 'x2': bs.northeastLng, 'y2': bs.northeastLat };
}
/**
@@ -466,17 +470,28 @@
if(!isShowGrid||moralMap.getZoom()<14){
return;
}
- var XY = bs();
+ var XY = getBounds();
var polygons = [];
console.log(XY);
- for (var i = XY.x1; i < XY.x2; i = i + 0.0063) {
- for (var j = XY.y2; j > XY.y1; j = j - 0.0048) {
+ var X1 = XY.x1;
+ var Y2 = XY.y2;
+ var X0 = getBounds.topLeftAnchor.x0;
+ var Y0 = getBounds.topLeftAnchor.y0;
+ var width = 0.0063;
+ var height = 0.0048;
+ // var multiple = 1000000;
+ if(!!getBounds.topLeftAnchor) {
+ X1=X0 + Math.ceil((X1-X0)/width-1)*width;
+ Y2=Y0 + Math.ceil((Y2-Y0)/height)*height;
+ }
+ for (var i = X1; i < XY.x2; i = i + width) {
+ for (var j = Y2; j > XY.y1; j = j - height) {
//���������������������������������������������������:������������������Point���������������������������,���������������������������,���������������������������,���������������������������������������������������������������������������������������������������������������,������������������������������������������������������������������
var polygon = new BMap.Polygon([
new BMap.Point(i, j), //������������������
- new BMap.Point(i, j-0.0048), //������������������
- new BMap.Point(i+0.0063, j-0.0048), //������������������
- new BMap.Point(i+0.0063, j) //������������������
+ new BMap.Point(i, j-height), //������������������
+ new BMap.Point(i+width, j-height), //������������������
+ new BMap.Point(i+width, j) //������������������
], {strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5, fillOpacity:0.1});
// polygon .addEventListener("click",function clickFunction(){
// alert("������������������");
@@ -493,7 +508,7 @@
}
// ������������������ ������������
moralMap.addEventListener("click", function(type, target) {
- moralMap.closePopupbox("#popup_box");
+ //moralMap.closePopupbox("#popup_box");
});
//������������������������������������������
moralMap.addEventListener('zoomstart', function(type) {});
@@ -505,7 +520,7 @@
}else{
loadOverlays("get-monitorpoints",addOverMpoints);
}
- moralMap.closePopupbox("#popup_box");
+ //moralMap.closePopupbox("#popup_box");
});
moralMap.addEventListener('moveend', function(type) {
var endZoom = this.getZoom();
@@ -514,13 +529,13 @@
}else{
loadOverlays("get-monitorpoints",addOverMpoints);
}
- moralMap.closePopupbox("#popup_box");
+ //moralMap.closePopupbox("#popup_box");
});
//���������������������
$("#searchBtn").click(
function(e) {
var param = encodeURI($("#searchParam").val());
- moralMap.showPopupbox("#popup_box");
+ //moralMap.showPopupbox("#popup_box");
var url = 'get-devices-for-popup?name=' + param + "&orgId=" + params['orgId'];
listView.load(url);
}
@@ -567,12 +582,12 @@
//������������
function refreshAllState() {
var parma={};
- if(moralMap.isPopupBoxShow("#popup_box")) {
+ /* if(moralMap.isPopupBoxShow("#popup_box")) {
var popupEquMacs = moralMap.getPopupEquMacs();
if(popupEquMacs!=null&&popupEquMacs.length>0){
parma["popupEquMacs"] = popupEquMacs;
}
- }
+ } */
//������������
var oldMarkerList = moralMap.getHorizonMarkers(true);
var markerKeys = [];
@@ -636,4 +651,8 @@
});
}
}
+
+ function callJS(jsonData){
+ moralMap.callJS(jsonData);
+ }
</script>
--
Gitblit v1.8.0