From f168f2a3e619b57280eba3b4fee680ee2bb891ed Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 16 Jul 2025 16:29:35 +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 --- .../lineManagement/child/threeSpanFormTemp.js | 4 +- .../js/synthesisQuery/digitalSignage-new.js | 69 ++++++++++++------- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js b/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js index ffd5cb4..8f34858 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js +++ b/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js @@ -460,7 +460,9 @@ function saveData(data) { tbSpanTowerList = JSON.parse(pointsStr).map((item) => { return { id: item.id || null, - lon: item.lng.toString().slice(0, 10), + lon: item.lon + ? item.lon.toString().slice(0, 10) + : item.lng.toString().slice(0, 10), lat: item.lat.toString().slice(0, 10), sort: item.sort, }; diff --git a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js index c83d218..fa33779 100644 --- a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js +++ b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js @@ -7,6 +7,7 @@ let cablewayList = []; // 索道列表 let towerList = []; // 塔列表 let crossingList = []; // 跨越列表 let crossingListNew = []; // 跨越列表 +let crossingLineListNew = []; // 跨越线列表 let highwayList = []; // 公路列表 let aThousandFieldsList = []; // 牵张场地 let intLng = 116.254; // 初始经度 @@ -306,6 +307,7 @@ function getLocationInfo(id) { crossingList = []; crossingListNew = []; + crossingLineListNew = []; cablewayList = []; towerList = []; @@ -324,6 +326,7 @@ function getLocationInfo(id) { } else { crossingList = []; crossingListNew = []; + crossingLineListNew = []; } if (data.highwayList.length > 0) { @@ -341,8 +344,10 @@ function getLocationInfo(id) { // 处理一下交叉信息 if (crossingList && crossingList.length > 0) { crossingList.forEach((item) => { + let lineList = []; if (item.lonAndLat && item.lonAndLat.indexOf(",") > -1) { const lonAndLatList = item.lonAndLat.split(","); + lonAndLatList.forEach((lonAndLat, index) => { const lonAndLatItem = lonAndLat.split("@"); crossingListNew.push({ @@ -350,8 +355,16 @@ function getLocationInfo(id) { baiduLat: lonAndLatItem[1], ...item, }); + + lineList.push({ + baiduLon: lonAndLatItem[0], + baiduLat: lonAndLatItem[1], + ...item, + }); }); } + + crossingLineListNew.push({ lineList }); }); } initMap(); @@ -717,7 +730,7 @@ async function addAllMapPoints() { }); graphicLayerList.push(billboard); - // graphicLayerList.push(graphic); + graphicLayerList.push(label2); }); } @@ -931,35 +944,43 @@ async function addMapLine() { }, }); graphicLayer.addGraphic(polyline); + graphicLayerList.push(polyline); } } // 绘制交叉线路 - if (crossingListNew.length > 0) { - for (let i = 0; i < crossingListNew.length - 1; i++) { - const startPoint = crossingListNew[i]; - const endPoint = crossingListNew[i + 1]; + if (crossingLineListNew.length > 0) { + for (let i = 0; i < crossingLineListNew.length; i++) { + for ( + let j = 0; + j < crossingLineListNew[i].lineList.length - 1; + j++ + ) { + const startPoint = crossingLineListNew[i].lineList[j]; + const endPoint = crossingLineListNew[i].lineList[j + 1]; - // 创建线段点数组 - const positions = [ - [startPoint.baiduLon, startPoint.baiduLat], - [endPoint.baiduLon, endPoint.baiduLat], - ]; + // 创建线段点数组 + const positions = [ + [startPoint.baiduLon, startPoint.baiduLat], + [endPoint.baiduLon, endPoint.baiduLat], + ]; - // const positions2 = positions.map((item) => { - // return mars3d.PointTrans.bd2wgs(item); - // }); + // const positions2 = positions.map((item) => { + // return mars3d.PointTrans.bd2wgs(item); + // }); - const polyline = new mars3d.graphic.PolylineEntity({ - positions: positions, - eventParent: false, - style: { - width: 2, // 线宽(像素) - color: "#800080", // 线颜色 - clampToGround: true, // 是否贴地(山区建议设为true) - }, - }); - graphicLayer.addGraphic(polyline); + const polyline = new mars3d.graphic.PolylineEntity({ + positions: positions, + eventParent: false, + style: { + width: 2, // 线宽(像素) + color: "#800080", // 线颜色 + clampToGround: true, // 是否贴地(山区建议设为true) + }, + }); + graphicLayer.addGraphic(polyline); + graphicLayerList.push(polyline); + } } } @@ -998,6 +1019,7 @@ async function addMapLine() { }, }); graphicLayer.addGraphic(polyline); + graphicLayerList.push(polyline); } } }); @@ -1037,6 +1059,7 @@ async function addMapLine() { }, }); graphicLayer.addGraphic(polyline); + graphicLayerList.push(polyline); } } }