From a4ea65f4329b54ceb9d1febc091e0aa569dfa34d Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 22 May 2025 11:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/synthesisQuery/digitalSignage.css | 3 +- .../js/synthesisQuery/digitalSignage.js | 165 ++++++++++++------ 2 files changed, 110 insertions(+), 58 deletions(-) diff --git a/src/main/resources/static/css/synthesisQuery/digitalSignage.css b/src/main/resources/static/css/synthesisQuery/digitalSignage.css index 79b558b..332e6eb 100644 --- a/src/main/resources/static/css/synthesisQuery/digitalSignage.css +++ b/src/main/resources/static/css/synthesisQuery/digitalSignage.css @@ -161,7 +161,8 @@ body { .legend-box .legend-item:nth-child(2) img, .legend-box .legend-item:nth-child(3) img, .legend-box .legend-item:nth-child(5) img, -.legend-box .legend-item:nth-child(6) img { +.legend-box .legend-item:nth-child(6) img, +.legend-box .legend-item:nth-child(10) img { width: 10px; height: 18px; margin-left: 5px; diff --git a/src/main/resources/static/js/synthesisQuery/digitalSignage.js b/src/main/resources/static/js/synthesisQuery/digitalSignage.js index 33261b6..bfcded2 100644 --- a/src/main/resources/static/js/synthesisQuery/digitalSignage.js +++ b/src/main/resources/static/js/synthesisQuery/digitalSignage.js @@ -59,7 +59,7 @@ const legendData = [ { name: "未 开 始", value: 0, - icon: "../../img/digitalSignage/white.png", + icon: "../../img/digitalSignage/icon_one.png", }, { name: "索道运输", @@ -76,7 +76,7 @@ const legendData = [ // 地图配置项 const config = { polyline: { - strokeWeight: 2, // 线条宽度 + strokeWeight: 3, // 线条宽度 strokeOpacity: 0.9, // 透明度 strokeStyle: "dashed", // solid(实线)或dashed(虚线) enableEditing: false, // 是否可编辑 @@ -154,16 +154,14 @@ function initMap() { } map = new BMapGL.Map("map-box"); // 以第一个点为中心初始化地图 - map.centerAndZoom(new BMapGL.Point(intLng, intLat), 15); + map.centerAndZoom(new BMapGL.Point(intLng, intLat), 15, function () { + map.setRotation(30); + }); - // map.setTilt(73); //设置地图的倾斜角度 + map.setTilt(60); //设置地图的倾斜角度 map.enableScrollWheelZoom(true); // 启用滚轮缩放 - // map.setTilt(60); // 设置地图倾斜角度 - // map.setDisplayOptions({ - // building: true, // 显示3D建筑物 - // }); var navigationControl = new BMapGL.NavigationControl3D(); map.addControl(navigationControl); @@ -276,7 +274,7 @@ function addAllMapPoints() { 7: "../../img/digitalSignage/zt_red.png", 8: "../../img/digitalSignage/zt_purple.png", 9: "../../img/digitalSignage/zt_green.png", - 0: "../../img/digitalSignage/white.png", + 0: "../../img/digitalSignage/icon_one.png", 11: "../../img/digitalSignage/sd.png", 20: "../../img/digitalSignage/project.png", 21: "../../img/digitalSignage/zt_white.png", @@ -302,28 +300,37 @@ function addAllMapPoints() { // } // addedPoints[pointKey] = true; - const point = new BMapGL.Point( - pointData.baiduLon, - pointData.baiduLat - ); - // const point = new BMapGL.Point(117.132663, 31.877325); - bounds.push(point); - // 检查图标是否存在,不存在则使用默认图标 - const iconUrl = iconTypeList[11]; // 默认使用第一个图标 - const myIcon = new BMapGL.Icon(iconUrl, new BMapGL.Size(40, 40), { - anchor: new BMapGL.Size(30, 30), // 修正锚点位置为中心底部 - imageSize: new BMapGL.Size(40, 40), // 与实际图片尺寸一致 - }); + if ( + pointData.cablewaTransPointVoList && + pointData.cablewaTransPointVoList.length > 0 + ) { + const point = new BMapGL.Point( + pointData.cablewaTransPointVoList[0].lng, + pointData.cablewaTransPointVoList[0].lat + ); + // const point = new BMapGL.Point(117.132663, 31.877325); + bounds.push(point); - const marker = new BMapGL.Marker(point, { icon: myIcon }); + // 检查图标是否存在,不存在则使用默认图标 + const iconUrl = iconTypeList[11]; // 默认使用第一个图标 + const myIcon = new BMapGL.Icon( + iconUrl, + new BMapGL.Size(40, 40), + { + anchor: new BMapGL.Size(30, 30), // 修正锚点位置为中心底部 + imageSize: new BMapGL.Size(40, 40), // 与实际图片尺寸一致 + } + ); - // 添加信息窗口 + const marker = new BMapGL.Marker(point, { icon: myIcon }); - let infoContent = ""; + // 添加信息窗口 - // 索道 - infoContent = ` + let infoContent = ""; + + // 索道 + infoContent = `