From 9c98c171ec7a5c745947e31e3161f946601c4eef Mon Sep 17 00:00:00 2001 From: weidong Date: Sun, 4 Feb 2024 00:04:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/page/device_overview.html | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/sec-beidou/src/main/resources/templates/page/device_overview.html b/sec-beidou/src/main/resources/templates/page/device_overview.html index 27f29308..a0683be6 100644 --- a/sec-beidou/src/main/resources/templates/page/device_overview.html +++ b/sec-beidou/src/main/resources/templates/page/device_overview.html @@ -33,7 +33,7 @@
-
+
设备数量
@@ -49,7 +49,7 @@
-
+
告警统计
@@ -80,8 +80,10 @@ function initialize() { var map = new BMapGL.Map("map-container"); // 创建Map实例 var point = new BMapGL.Point(116.404, 39.915); - map.centerAndZoom(point, 6); + map.centerAndZoom(point, 7); map.enableScrollWheelZoom(true); + var centerLat = 0; + var centerLon = 0; var deviceList= [ [# th:each="device : ${deviceList}"] @@ -91,12 +93,15 @@ [/] ]; //console.log(deviceList); - /*var i=0; - for(; i0) { + centerLat = centerLat/deviceList.length; + centerLon = centerLon/deviceList.length; + map.setCenter(new BMapGL.Point(centerLon,centerLat)); } - if(i>0) map.setCenter(point);*/ translateCallback = function (data){ if(data.status === 0) { @@ -104,7 +109,6 @@ for(; i0) map.setCenter(data.points[i-1]); } }