From 078af6a6565bf34a8b0560ba6ade97ca630dbce6 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Mon, 13 Aug 2018 15:00:18 +0800
Subject: [PATCH] 地图调整
---
src/main/webapp/view/map.jsp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/src/main/webapp/view/map.jsp b/src/main/webapp/view/map.jsp
index 60b70ab..6c1c04a 100644
--- a/src/main/webapp/view/map.jsp
+++ b/src/main/webapp/view/map.jsp
@@ -437,10 +437,58 @@
paramMap["Le"]= bounds.southwestLng;//���������������������������������
loadLazy("getMonitorpointList",paramMap,addOverMpoints);
startRefreshPage();
+ showGrid();
});
//��������������������� ���������������,���������
moralMap.addEventListener("tilesloaded", function(type, target) {
+ showGrid();
});
+
+ //map���������������
+ // TODO ������
+ function bs() {
+ var bs = moralMap.getBounds(); //������������������������������������
+ // var bssw = bs.getSouthWest(); //���������������������������(������������)
+ // var bsne = bs.getNorthEast(); //���������������������������(������������)
+ return { 'x1': bs.southwestLng, 'y1': bs.southwestLat, 'x2': bs.northeastLng, 'y2': bs.northeastLat };
+ }
+ /**
+ * ������������
+ */
+ // TODO ������
+ function showGrid(){
+ var isShowGrid = getUrlParam("isShowGrid");
+ if(!!isShowGrid){
+ $(".tools_box").hide();
+ }
+ if(!isShowGrid||moralMap.getZoom()<14){
+ return;
+ }
+ var XY = bs();
+ 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) {
+ //���������������������������������������������������:������������������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) //������������������
+ ], {strokeColor:"blue", strokeWeight:2, strokeOpacity:1, fillOpacity:0.1});
+ // polygon .addEventListener("click",function clickFunction(){
+ // alert("������������������");
+ // });
+ // moralMap.addOverlay(polygon);
+ polygons.push(polygon);
+ }
+ }
+ moralMap.addOverlays(polygons);
+ if(!!showGrid.polygons){
+ moralMap.removeOverlays(showGrid.polygons);
+ }
+ showGrid.polygons = polygons;
+ }
// ������������������ ������������
moralMap.addEventListener("click", function(type, target) {
moralMap.closePopupbox("#popup_box");
@@ -450,7 +498,7 @@
//������������������������������������������
moralMap.addEventListener('zoomend', function(type) {
var endZoom = this.getZoom();
- if(endZoom>=moralMap.getZooMConfine()){//������������������������
+ if(endZoom>=moralMap.getZoomConfine()){//������������������������
loadOverlays("get-devices",addOverEquipments);
}else{
loadOverlays("get-monitorpoints",addOverMpoints);
@@ -459,7 +507,7 @@
});
moralMap.addEventListener('moveend', function(type) {
var endZoom = this.getZoom();
- if(endZoom>=moralMap.getZooMConfine()){//������������������������
+ if(endZoom>=moralMap.getZoomConfine()){//������������������������
loadOverlays("get-devices",addOverEquipments);
}else{
loadOverlays("get-monitorpoints",addOverMpoints);
--
Gitblit v1.8.0