From 427b38c8f1e7857c2a885e61759789fb0343c632 Mon Sep 17 00:00:00 2001 From: fengyarnom Date: Wed, 11 Jun 2025 16:56:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/page/device_overview.html | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 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 0c95066f..bc1619fe 100644 --- a/sec-beidou/src/main/resources/templates/page/device_overview.html +++ b/sec-beidou/src/main/resources/templates/page/device_overview.html @@ -34,13 +34,13 @@ } .top-panel-number { - /* line-height: 60px; // 删除或注释掉这一行 */ + /* line-height: 60px; */ font-size: 30px; border-right: 1px solid #eceff9; height: 100%; display: flex; align-items: center; - justify-content: center; /* 可选:让数字水平居中 */ + justify-content: center; } .top-panel-tips{ line-height:30px; @@ -153,7 +153,7 @@
-
+
设备数量
@@ -398,25 +398,20 @@ map.removeLayer(currentBaseLayer); currentBaseLayer = mapLayers[mapType]; map.getLayers().insertAt(0, currentBaseLayer); - - // 更新我的位置标记,使用正确的坐标系 + updateMyLocationForMapType(mapType); - - // 更新设备标记 addDeviceMarkers(); } // 根据地图类型更新我的位置标记 function updateMyLocationForMapType(mapType) { if (myLocationFeature) { - // 获取原始坐标 var originalCoords = myLocationFeature.get('originalCoords'); if (originalCoords) { var lat = originalCoords.lat; var lon = originalCoords.lon; var coordinates; - - // 根据地图类型进行坐标转换 + if (mapType === 'amap' || mapType === 'amap_satellite') { // 高德地图使用GCJ-02坐标系,需要转换 var gcjCoord = transform(lat, lon); @@ -425,18 +420,15 @@ // 天地图使用CGCS2000/WGS84坐标系,直接使用 coordinates = ol.proj.fromLonLat([lon, lat]); } - - // 更新位置标记的几何坐标 + myLocationFeature.getGeometry().setCoordinates(coordinates); } } } function addDeviceMarkers() { - // 保存我的位置标记 var savedMyLocationFeature = myLocationFeature; - - // 清除现有标记 + vectorSource.clear(); greenFeatures = []; orangeFeatures = []; -- 2.39.5