From 13090956025fa82de33cb8907359294a01e784fa Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 30 Jul 2025 16:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BB=A5=E5=8F=8A=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=80=A7=E8=83=BD=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 | 33 +-- .../child/setHighwayLonAndLat.js | 196 +++++++++-------- .../lineManagement/child/setLonAndLat.js | 203 +++++++++--------- .../child/setQzSiteLonAndLat.js | 197 +++++++++-------- .../child/setSpanTowerLonAndLat.js | 196 +++++++++-------- .../lineManagement/child/threeSpanFormTemp.js | 58 ++--- .../js/synthesisQuery/digitalSignage-new.js | 42 ++-- .../lineManagement/child/setLonAndLat.html | 6 +- .../pages/synthesisQuery/digitalSignage.html | 4 +- 9 files changed, 499 insertions(+), 436 deletions(-) diff --git a/src/main/resources/static/css/synthesisQuery/digitalSignage.css b/src/main/resources/static/css/synthesisQuery/digitalSignage.css index b184a1f..2c0bf30 100644 --- a/src/main/resources/static/css/synthesisQuery/digitalSignage.css +++ b/src/main/resources/static/css/synthesisQuery/digitalSignage.css @@ -138,27 +138,31 @@ body { /* bottom: 15px; */ top: 50px; left: 15px; - width: 140px; - height: 280px; + /* width: 140px; */ + /* height: 280px; */ display: flex; flex-direction: column; - justify-content: space-around; + justify-content: space-between; border-radius: 10px; visibility: visible; } .legend-box .legend-item { - padding: 0 6px; + padding: 4px 8px; display: flex; align-items: center; justify-content: space-between; - font-size: 14px; + font-size: 16px; +} + +.legend-item-name { + margin: 0 6px; } .legend-box .legend-item img { - width: 20px; - height: 20px; + width: 26px; + height: 26px; } /* .legend-box .legend-item:nth-child(1) img, @@ -213,12 +217,12 @@ body { position: absolute; bottom: 35px; left: 15px; - width: 260px; + width: 40%; padding: 10px; background: rgba(0, 0, 0, 0.6); border-radius: 10px; z-index: 999; - visibility: visible; + visibility: hidden; /* display: flex; flex-direction: column; @@ -254,7 +258,7 @@ body { .project-overview-title { padding-bottom: 10px 0; - font-size: 14px; + font-size: 20px; font-weight: bold; text-align: center; color: #fff; @@ -264,18 +268,18 @@ body { text-indent: 2em; /* max-height: 220px; */ color: #fff; - font-size: 14px; + font-size: 16px; letter-spacing: 1px; /* padding-bottom: 10px; */ /* 设置溢出隐藏显示... */ /* overflow: hidden; text-overflow: ellipsis; white-space: nowrap; */ - display: -webkit-box; - -webkit-line-clamp: 12; /* 限制显示的行数 */ + /* display: -webkit-box; + -webkit-line-clamp: 12; -webkit-box-orient: vertical; overflow: hidden; - text-overflow: ellipsis; + text-overflow: ellipsis; */ } /* 索道信息窗口样式 */ @@ -369,6 +373,7 @@ body { border-color: transparent #d7d7d7 transparent transparent; z-index: 999; cursor: pointer; + transform: rotate(180deg); } .close-drawer-btn { diff --git a/src/main/resources/static/js/basic/lineManagement/child/setHighwayLonAndLat.js b/src/main/resources/static/js/basic/lineManagement/child/setHighwayLonAndLat.js index c6089f8..06dc901 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/setHighwayLonAndLat.js +++ b/src/main/resources/static/js/basic/lineManagement/child/setHighwayLonAndLat.js @@ -12,55 +12,109 @@ let lineList = []; const mapConfig = { scene: { + // center: { + // lat: 31.686288, + // lng: 117.229619, + // alt: 12000, // 高度≈缩放级别 + // }, + + // highDynamicRange: false, // 关闭HDR(可减少模糊) + + // scene3DOnly: false, + // shadows: false, + // removeDblClick: true, + // sceneMode: 1, + // showSun: true, + // showMoon: true, + // showSkyBox: true, + // showSkyAtmosphere: true, + // fog: true, + // fxaa: false, + // requestRenderMode: false, + // globe: { + // depthTestAgainstTerrain: false, + // baseColor: "#546a53", + // // showGroundAtmosphere: true, + // showGroundAtmosphere: true, + // enableLighting: false, + // }, + // cameraController: { + // zoomFactor: 3.0, + // minimumZoomDistance: 1, + // maximumZoomDistance: 50000000, + // enableRotate: true, + // enableTranslate: true, + // enableTilt: true, + // enableZoom: true, + // enableCollisionDetection: true, + // minimumCollisionTerrainHeight: 15000, + // }, + center: { lat: 31.686288, lng: 117.229619, - // alt: 11333.9, - // heading: 359.2, - // pitch: -39.5, alt: 12000, // 高度≈缩放级别 - // heading: 30, // 旋转30度 - // pitch: -45, // 俯视角45度 }, - - highDynamicRange: false, // 关闭HDR(可减少模糊) - + // 强制2D模式 + sceneMode: 2, // 2表示2D模式,1是3D scene3DOnly: false, + + // 简化渲染设置 + highDynamicRange: false, shadows: false, removeDblClick: true, - sceneMode: 1, - showSun: true, - showMoon: true, - showSkyBox: true, - showSkyAtmosphere: true, - fog: true, + showSun: false, // 2D模式下不需要太阳月亮 + showMoon: false, + showSkyBox: false, // 2D模式不需要天空盒 + showSkyAtmosphere: false, + fog: false, // 关闭雾化提升性能 fxaa: false, - requestRenderMode: false, + requestRenderMode: true, // 启用按需渲染提升性能 + + // 简化地球配置 globe: { depthTestAgainstTerrain: false, baseColor: "#546a53", - showGroundAtmosphere: true, + showGroundAtmosphere: false, enableLighting: false, }, + + // 简化相机控制(仅保留2D必要操作) cameraController: { zoomFactor: 3.0, minimumZoomDistance: 1, maximumZoomDistance: 50000000, - enableRotate: true, - enableTranslate: true, - enableTilt: true, - enableZoom: true, - enableCollisionDetection: true, - minimumCollisionTerrainHeight: 15000, + enableRotate: false, // 2D模式下不需要旋转 + enableTranslate: true, // 允许平移 + enableTilt: false, // 2D模式下不需要倾斜 + enableZoom: true, // 允许缩放 + enableCollisionDetection: false, // 2D模式下不需要碰撞检测 }, }, control: { - homeButton: true, - baseLayerPicker: true, - sceneModePicker: true, - vrButton: false, - fullscreenButton: true, - navigationHelpButton: true, + // homeButton: true, + // baseLayerPicker: true, + // sceneModePicker: true, + // vrButton: false, + // fullscreenButton: true, + // navigationHelpButton: true, + // animation: false, + // timeline: false, + // infoBox: false, + // geocoder: false, + // selectionIndicator: false, + // contextmenu: { hasDefault: false }, + // mouseDownView: true, + // zoom: { insertIndex: 1 }, + // compass: { bottom: "toolbar", left: "5px" }, + // distanceLegend: { left: "10px", bottom: "2px" }, + + homeButton: true, // 保留首页按钮 + baseLayerPicker: false, // 隐藏底图切换 + sceneModePicker: false, // 隐藏2D/3D切换 + vrButton: false, // 隐藏VR按钮 + fullscreenButton: true, // 保留全屏按钮 + navigationHelpButton: false, // 隐藏帮助按钮 animation: false, timeline: false, infoBox: false, @@ -68,23 +122,19 @@ const mapConfig = { selectionIndicator: false, contextmenu: { hasDefault: false }, mouseDownView: true, - zoom: { insertIndex: 1 }, - compass: { bottom: "toolbar", left: "5px" }, - distanceLegend: { left: "10px", bottom: "2px" }, - locationBar: { - fps: true, - crs: "CGCS2000_GK_Zone_3", - crsDecimal: 0, - template: - "
经度:{lng}
纬度:{lat}
横{crsx} 纵{crsy}
海拔:{alt}米
层级:{level}
方向:{heading}°
俯仰角:{pitch}°
视高:{cameraHeight}米
", - }, + zoom: { insertIndex: 1 }, // 保留缩放控件 + compass: false, // 隐藏指南针(2D不需要) + distanceLegend: false, // 隐藏距离图例 }, templateValues: { + // dataServer: "//data.mars3d.cn", + // gltfServerUrl: "//data.mars3d.cn/gltf", dataServer: "//data.mars3d.cn", gltfServerUrl: "//data.mars3d.cn/gltf", }, terrain: { - url: "//data.mars3d.cn/terrain", + // url: "//data.mars3d.cn/terrain", + // show: false, show: false, }, basemaps: [ @@ -111,57 +161,6 @@ const mapConfig = { { name: "注记", type: "tdt", layer: "vec_z" }, ], }, - { - pid: 10, - name: "高德影像", - type: "group", - icon: "../../../../img/mars-map-img/gaode_img.png", - layers: [ - { name: "底图", type: "gaode", layer: "img_d" }, - { name: "注记", type: "gaode", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "高德电子", - type: "gaode", - icon: "../../../../img/mars-map-img/gaode_vec.png", - layer: "vec", - }, - { - pid: 10, - name: "百度影像", - type: "group", - icon: "../../../../img/mars-map-img/bd-img.png", - layers: [ - { name: "底图", type: "baidu", layer: "img_d" }, - { name: "注记", type: "baidu", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "百度电子", - icon: "../../../../img/mars-map-img/bd-vec.png", - type: "baidu", - layer: "vec", - }, - { - pid: 10, - name: "腾讯影像", - icon: "../../../../img/mars-map-img/tencent_img.png", - type: "group", - layers: [ - { name: "底图", type: "tencent", layer: "img_d" }, - { name: "注记", type: "tencent", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "腾讯电子", - icon: "../../../../img/mars-map-img/tencent_vec.png", - type: "tencent", - layer: "vec", - }, { pid: 10, name: "ArcGIS影像", @@ -232,7 +231,13 @@ function initData() { intLat = list[0].proLat ? list[0].proLat : list[0].lat; } } - initMap(list); + // initMap(list); + $(document).ready(function () { + // 延迟初始化,确保 DOM 已就绪 + setTimeout(() => { + initMap(list); + }, 300); + }); } } @@ -772,12 +777,21 @@ function saveData() { .getElementsByTagName("iframe")[0]; frameId.contentWindow.savePointData(JSON.stringify(points)); parent.layer.msg("保存成功", { icon: 1 }); + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } // 关闭页面 function closePage() { + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } + +function destroyMap() { + if (window.mapInstance) { + window.mapInstance.destroy(); + window.mapInstance = null; + } +} diff --git a/src/main/resources/static/js/basic/lineManagement/child/setLonAndLat.js b/src/main/resources/static/js/basic/lineManagement/child/setLonAndLat.js index 7222413..a98089a 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/setLonAndLat.js +++ b/src/main/resources/static/js/basic/lineManagement/child/setLonAndLat.js @@ -14,61 +14,109 @@ let lineList = []; const mapConfig = { scene: { + // center: { + // lat: 31.686288, + // lng: 117.229619, + // alt: 12000, // 高度≈缩放级别 + // }, + + // highDynamicRange: false, // 关闭HDR(可减少模糊) + + // scene3DOnly: false, + // shadows: false, + // removeDblClick: true, + // sceneMode: 1, + // showSun: true, + // showMoon: true, + // showSkyBox: true, + // showSkyAtmosphere: true, + // fog: true, + // fxaa: false, + // requestRenderMode: false, + // globe: { + // depthTestAgainstTerrain: false, + // baseColor: "#546a53", + // // showGroundAtmosphere: true, + // showGroundAtmosphere: true, + // enableLighting: false, + // }, + // cameraController: { + // zoomFactor: 3.0, + // minimumZoomDistance: 1, + // maximumZoomDistance: 50000000, + // enableRotate: true, + // enableTranslate: true, + // enableTilt: true, + // enableZoom: true, + // enableCollisionDetection: true, + // minimumCollisionTerrainHeight: 15000, + // }, + center: { lat: 31.686288, lng: 117.229619, - // alt: 11333.9, - // heading: 359.2, - // pitch: -39.5, alt: 12000, // 高度≈缩放级别 - // heading: 30, // 旋转30度 - // pitch: -45, // 俯视角45度 }, - - highDynamicRange: false, // 关闭HDR(可减少模糊) - + // 强制2D模式 + sceneMode: 2, // 2表示2D模式,1是3D scene3DOnly: false, + + // 简化渲染设置 + highDynamicRange: false, shadows: false, removeDblClick: true, - sceneMode: 1, - showSun: true, - showMoon: true, - showSkyBox: true, - showSkyAtmosphere: true, - - // showSun: false, // 2D模式下可关闭 - // showMoon: false, // 2D模式下可关闭 - // showSkyBox: false, // 2D模式下可关闭 - // fog: false, // 2D模式下可关闭 - fog: true, + showSun: false, // 2D模式下不需要太阳月亮 + showMoon: false, + showSkyBox: false, // 2D模式不需要天空盒 + showSkyAtmosphere: false, + fog: false, // 关闭雾化提升性能 fxaa: false, - requestRenderMode: false, + requestRenderMode: true, // 启用按需渲染提升性能 + + // 简化地球配置 globe: { depthTestAgainstTerrain: false, baseColor: "#546a53", - // showGroundAtmosphere: true, - showGroundAtmosphere: true, + showGroundAtmosphere: false, enableLighting: false, }, + + // 简化相机控制(仅保留2D必要操作) cameraController: { zoomFactor: 3.0, minimumZoomDistance: 1, maximumZoomDistance: 50000000, - enableRotate: true, - enableTranslate: true, - enableTilt: true, - enableZoom: true, - enableCollisionDetection: true, - minimumCollisionTerrainHeight: 15000, + enableRotate: false, // 2D模式下不需要旋转 + enableTranslate: true, // 允许平移 + enableTilt: false, // 2D模式下不需要倾斜 + enableZoom: true, // 允许缩放 + enableCollisionDetection: false, // 2D模式下不需要碰撞检测 }, }, control: { - homeButton: true, - baseLayerPicker: true, - sceneModePicker: true, - vrButton: false, - fullscreenButton: true, - navigationHelpButton: true, + // homeButton: true, + // baseLayerPicker: true, + // sceneModePicker: true, + // vrButton: false, + // fullscreenButton: true, + // navigationHelpButton: true, + // animation: false, + // timeline: false, + // infoBox: false, + // geocoder: false, + // selectionIndicator: false, + // contextmenu: { hasDefault: false }, + // mouseDownView: true, + // zoom: { insertIndex: 1 }, + // compass: { bottom: "toolbar", left: "5px" }, + // distanceLegend: { left: "10px", bottom: "2px" }, + + homeButton: true, // 保留首页按钮 + baseLayerPicker: false, // 隐藏底图切换 + sceneModePicker: false, // 隐藏2D/3D切换 + vrButton: false, // 隐藏VR按钮 + fullscreenButton: true, // 保留全屏按钮 + navigationHelpButton: false, // 隐藏帮助按钮 animation: false, timeline: false, infoBox: false, @@ -76,23 +124,19 @@ const mapConfig = { selectionIndicator: false, contextmenu: { hasDefault: false }, mouseDownView: true, - zoom: { insertIndex: 1 }, - compass: { bottom: "toolbar", left: "5px" }, - distanceLegend: { left: "10px", bottom: "2px" }, - locationBar: { - fps: true, - crs: "CGCS2000_GK_Zone_3", - crsDecimal: 0, - template: - "
经度:{lng}
纬度:{lat}
横{crsx} 纵{crsy}
海拔:{alt}米
层级:{level}
方向:{heading}°
俯仰角:{pitch}°
视高:{cameraHeight}米
", - }, + zoom: { insertIndex: 1 }, // 保留缩放控件 + compass: false, // 隐藏指南针(2D不需要) + distanceLegend: false, // 隐藏距离图例 }, templateValues: { + // dataServer: "//data.mars3d.cn", + // gltfServerUrl: "//data.mars3d.cn/gltf", dataServer: "//data.mars3d.cn", gltfServerUrl: "//data.mars3d.cn/gltf", }, terrain: { - url: "//data.mars3d.cn/terrain", + // url: "//data.mars3d.cn/terrain", + // show: false, show: false, }, basemaps: [ @@ -119,57 +163,6 @@ const mapConfig = { { name: "注记", type: "tdt", layer: "vec_z" }, ], }, - { - pid: 10, - name: "高德影像", - type: "group", - icon: "../../../../img/mars-map-img/gaode_img.png", - layers: [ - { name: "底图", type: "gaode", layer: "img_d" }, - { name: "注记", type: "gaode", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "高德电子", - type: "gaode", - icon: "../../../../img/mars-map-img/gaode_vec.png", - layer: "vec", - }, - { - pid: 10, - name: "百度影像", - type: "group", - icon: "../../../../img/mars-map-img/bd-img.png", - layers: [ - { name: "底图", type: "baidu", layer: "img_d" }, - { name: "注记", type: "baidu", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "百度电子", - icon: "../../../../img/mars-map-img/bd-vec.png", - type: "baidu", - layer: "vec", - }, - { - pid: 10, - name: "腾讯影像", - icon: "../../../../img/mars-map-img/tencent_img.png", - type: "group", - layers: [ - { name: "底图", type: "tencent", layer: "img_d" }, - { name: "注记", type: "tencent", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "腾讯电子", - icon: "../../../../img/mars-map-img/tencent_vec.png", - type: "tencent", - layer: "vec", - }, { pid: 10, name: "ArcGIS影像", @@ -240,7 +233,14 @@ function initData() { intLat = list[0].proLat ? list[0].proLat : list[0].lat; } } - initMap(list); + // initMap(list); + + $(document).ready(function () { + // 延迟初始化,确保 DOM 已就绪 + setTimeout(() => { + initMap(list); + }, 300); + }); } } @@ -778,12 +778,21 @@ function saveData() { .getElementsByTagName("iframe")[0]; frameId.contentWindow.savePointData(JSON.stringify(points)); parent.layer.msg("保存成功", { icon: 1 }); + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } // 关闭页面 function closePage() { + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } + +function destroyMap() { + if (window.mapInstance) { + window.mapInstance.destroy(); + window.mapInstance = null; + } +} diff --git a/src/main/resources/static/js/basic/lineManagement/child/setQzSiteLonAndLat.js b/src/main/resources/static/js/basic/lineManagement/child/setQzSiteLonAndLat.js index 863f413..ac5973d 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/setQzSiteLonAndLat.js +++ b/src/main/resources/static/js/basic/lineManagement/child/setQzSiteLonAndLat.js @@ -12,55 +12,109 @@ let lineList = []; let graphicLayerList = []; const mapConfig = { scene: { + // center: { + // lat: 31.686288, + // lng: 117.229619, + // alt: 12000, // 高度≈缩放级别 + // }, + + // highDynamicRange: false, // 关闭HDR(可减少模糊) + + // scene3DOnly: false, + // shadows: false, + // removeDblClick: true, + // sceneMode: 1, + // showSun: true, + // showMoon: true, + // showSkyBox: true, + // showSkyAtmosphere: true, + // fog: true, + // fxaa: false, + // requestRenderMode: false, + // globe: { + // depthTestAgainstTerrain: false, + // baseColor: "#546a53", + // // showGroundAtmosphere: true, + // showGroundAtmosphere: true, + // enableLighting: false, + // }, + // cameraController: { + // zoomFactor: 3.0, + // minimumZoomDistance: 1, + // maximumZoomDistance: 50000000, + // enableRotate: true, + // enableTranslate: true, + // enableTilt: true, + // enableZoom: true, + // enableCollisionDetection: true, + // minimumCollisionTerrainHeight: 15000, + // }, + center: { lat: 31.686288, lng: 117.229619, - // alt: 11333.9, - // heading: 359.2, - // pitch: -39.5, alt: 12000, // 高度≈缩放级别 - // heading: 30, // 旋转30度 - // pitch: -45, // 俯视角45度 }, - - highDynamicRange: false, // 关闭HDR(可减少模糊) - + // 强制2D模式 + sceneMode: 2, // 2表示2D模式,1是3D scene3DOnly: false, + + // 简化渲染设置 + highDynamicRange: false, shadows: false, removeDblClick: true, - sceneMode: 1, - showSun: true, - showMoon: true, - showSkyBox: true, - showSkyAtmosphere: true, - fog: true, + showSun: false, // 2D模式下不需要太阳月亮 + showMoon: false, + showSkyBox: false, // 2D模式不需要天空盒 + showSkyAtmosphere: false, + fog: false, // 关闭雾化提升性能 fxaa: false, - requestRenderMode: false, + requestRenderMode: true, // 启用按需渲染提升性能 + + // 简化地球配置 globe: { depthTestAgainstTerrain: false, baseColor: "#546a53", - showGroundAtmosphere: true, + showGroundAtmosphere: false, enableLighting: false, }, + + // 简化相机控制(仅保留2D必要操作) cameraController: { zoomFactor: 3.0, minimumZoomDistance: 1, maximumZoomDistance: 50000000, - enableRotate: true, - enableTranslate: true, - enableTilt: true, - enableZoom: true, - enableCollisionDetection: true, - minimumCollisionTerrainHeight: 15000, + enableRotate: false, // 2D模式下不需要旋转 + enableTranslate: true, // 允许平移 + enableTilt: false, // 2D模式下不需要倾斜 + enableZoom: true, // 允许缩放 + enableCollisionDetection: false, // 2D模式下不需要碰撞检测 }, }, control: { - homeButton: true, - baseLayerPicker: true, - sceneModePicker: true, - vrButton: false, - fullscreenButton: true, - navigationHelpButton: true, + // homeButton: true, + // baseLayerPicker: true, + // sceneModePicker: true, + // vrButton: false, + // fullscreenButton: true, + // navigationHelpButton: true, + // animation: false, + // timeline: false, + // infoBox: false, + // geocoder: false, + // selectionIndicator: false, + // contextmenu: { hasDefault: false }, + // mouseDownView: true, + // zoom: { insertIndex: 1 }, + // compass: { bottom: "toolbar", left: "5px" }, + // distanceLegend: { left: "10px", bottom: "2px" }, + + homeButton: true, // 保留首页按钮 + baseLayerPicker: false, // 隐藏底图切换 + sceneModePicker: false, // 隐藏2D/3D切换 + vrButton: false, // 隐藏VR按钮 + fullscreenButton: true, // 保留全屏按钮 + navigationHelpButton: false, // 隐藏帮助按钮 animation: false, timeline: false, infoBox: false, @@ -68,23 +122,19 @@ const mapConfig = { selectionIndicator: false, contextmenu: { hasDefault: false }, mouseDownView: true, - zoom: { insertIndex: 1 }, - compass: { bottom: "toolbar", left: "5px" }, - distanceLegend: { left: "10px", bottom: "2px" }, - locationBar: { - fps: true, - crs: "CGCS2000_GK_Zone_3", - crsDecimal: 0, - template: - "
经度:{lng}
纬度:{lat}
横{crsx} 纵{crsy}
海拔:{alt}米
层级:{level}
方向:{heading}°
俯仰角:{pitch}°
视高:{cameraHeight}米
", - }, + zoom: { insertIndex: 1 }, // 保留缩放控件 + compass: false, // 隐藏指南针(2D不需要) + distanceLegend: false, // 隐藏距离图例 }, templateValues: { + // dataServer: "//data.mars3d.cn", + // gltfServerUrl: "//data.mars3d.cn/gltf", dataServer: "//data.mars3d.cn", gltfServerUrl: "//data.mars3d.cn/gltf", }, terrain: { - url: "//data.mars3d.cn/terrain", + // url: "//data.mars3d.cn/terrain", + // show: false, show: false, }, basemaps: [ @@ -111,57 +161,6 @@ const mapConfig = { { name: "注记", type: "tdt", layer: "vec_z" }, ], }, - { - pid: 10, - name: "高德影像", - type: "group", - icon: "../../../../img/mars-map-img/gaode_img.png", - layers: [ - { name: "底图", type: "gaode", layer: "img_d" }, - { name: "注记", type: "gaode", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "高德电子", - type: "gaode", - icon: "../../../../img/mars-map-img/gaode_vec.png", - layer: "vec", - }, - { - pid: 10, - name: "百度影像", - type: "group", - icon: "../../../../img/mars-map-img/bd-img.png", - layers: [ - { name: "底图", type: "baidu", layer: "img_d" }, - { name: "注记", type: "baidu", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "百度电子", - icon: "../../../../img/mars-map-img/bd-vec.png", - type: "baidu", - layer: "vec", - }, - { - pid: 10, - name: "腾讯影像", - icon: "../../../../img/mars-map-img/tencent_img.png", - type: "group", - layers: [ - { name: "底图", type: "tencent", layer: "img_d" }, - { name: "注记", type: "tencent", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "腾讯电子", - icon: "../../../../img/mars-map-img/tencent_vec.png", - type: "tencent", - layer: "vec", - }, { pid: 10, name: "ArcGIS影像", @@ -172,7 +171,6 @@ const mapConfig = { }, ], }; - function setParams(obj) { objParams = JSON.parse(obj); layui.use(["form", "layer"], function () { @@ -232,7 +230,13 @@ function initData() { intLat = list[0].proLat ? list[0].proLat : list[0].lat; } } - initMap(list); + // initMap(list); + $(document).ready(function () { + // 延迟初始化,确保 DOM 已就绪 + setTimeout(() => { + initMap(list); + }, 300); + }); } } @@ -771,12 +775,21 @@ function saveData() { .getElementsByTagName("iframe")[0]; frameId.contentWindow.savePointData(JSON.stringify(points)); parent.layer.msg("保存成功", { icon: 1 }); + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } // 关闭页面 function closePage() { + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } + +function destroyMap() { + if (window.mapInstance) { + window.mapInstance.destroy(); + window.mapInstance = null; + } +} diff --git a/src/main/resources/static/js/basic/lineManagement/child/setSpanTowerLonAndLat.js b/src/main/resources/static/js/basic/lineManagement/child/setSpanTowerLonAndLat.js index fec9e72..d6fe85c 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/setSpanTowerLonAndLat.js +++ b/src/main/resources/static/js/basic/lineManagement/child/setSpanTowerLonAndLat.js @@ -12,55 +12,109 @@ let lineList = []; const mapConfig = { scene: { + // center: { + // lat: 31.686288, + // lng: 117.229619, + // alt: 12000, // 高度≈缩放级别 + // }, + + // highDynamicRange: false, // 关闭HDR(可减少模糊) + + // scene3DOnly: false, + // shadows: false, + // removeDblClick: true, + // sceneMode: 1, + // showSun: true, + // showMoon: true, + // showSkyBox: true, + // showSkyAtmosphere: true, + // fog: true, + // fxaa: false, + // requestRenderMode: false, + // globe: { + // depthTestAgainstTerrain: false, + // baseColor: "#546a53", + // // showGroundAtmosphere: true, + // showGroundAtmosphere: true, + // enableLighting: false, + // }, + // cameraController: { + // zoomFactor: 3.0, + // minimumZoomDistance: 1, + // maximumZoomDistance: 50000000, + // enableRotate: true, + // enableTranslate: true, + // enableTilt: true, + // enableZoom: true, + // enableCollisionDetection: true, + // minimumCollisionTerrainHeight: 15000, + // }, + center: { lat: 31.686288, lng: 117.229619, - // alt: 11333.9, - // heading: 359.2, - // pitch: -39.5, alt: 12000, // 高度≈缩放级别 - // heading: 30, // 旋转30度 - // pitch: -45, // 俯视角45度 }, - - highDynamicRange: false, // 关闭HDR(可减少模糊) - + // 强制2D模式 + sceneMode: 2, // 2表示2D模式,1是3D scene3DOnly: false, + + // 简化渲染设置 + highDynamicRange: false, shadows: false, removeDblClick: true, - sceneMode: 1, - showSun: true, - showMoon: true, - showSkyBox: true, - showSkyAtmosphere: true, - fog: true, + showSun: false, // 2D模式下不需要太阳月亮 + showMoon: false, + showSkyBox: false, // 2D模式不需要天空盒 + showSkyAtmosphere: false, + fog: false, // 关闭雾化提升性能 fxaa: false, - requestRenderMode: false, + requestRenderMode: true, // 启用按需渲染提升性能 + + // 简化地球配置 globe: { depthTestAgainstTerrain: false, baseColor: "#546a53", - showGroundAtmosphere: true, + showGroundAtmosphere: false, enableLighting: false, }, + + // 简化相机控制(仅保留2D必要操作) cameraController: { zoomFactor: 3.0, minimumZoomDistance: 1, maximumZoomDistance: 50000000, - enableRotate: true, - enableTranslate: true, - enableTilt: true, - enableZoom: true, - enableCollisionDetection: true, - minimumCollisionTerrainHeight: 15000, + enableRotate: false, // 2D模式下不需要旋转 + enableTranslate: true, // 允许平移 + enableTilt: false, // 2D模式下不需要倾斜 + enableZoom: true, // 允许缩放 + enableCollisionDetection: false, // 2D模式下不需要碰撞检测 }, }, control: { - homeButton: true, - baseLayerPicker: true, - sceneModePicker: true, - vrButton: false, - fullscreenButton: true, - navigationHelpButton: true, + // homeButton: true, + // baseLayerPicker: true, + // sceneModePicker: true, + // vrButton: false, + // fullscreenButton: true, + // navigationHelpButton: true, + // animation: false, + // timeline: false, + // infoBox: false, + // geocoder: false, + // selectionIndicator: false, + // contextmenu: { hasDefault: false }, + // mouseDownView: true, + // zoom: { insertIndex: 1 }, + // compass: { bottom: "toolbar", left: "5px" }, + // distanceLegend: { left: "10px", bottom: "2px" }, + + homeButton: true, // 保留首页按钮 + baseLayerPicker: false, // 隐藏底图切换 + sceneModePicker: false, // 隐藏2D/3D切换 + vrButton: false, // 隐藏VR按钮 + fullscreenButton: true, // 保留全屏按钮 + navigationHelpButton: false, // 隐藏帮助按钮 animation: false, timeline: false, infoBox: false, @@ -68,23 +122,19 @@ const mapConfig = { selectionIndicator: false, contextmenu: { hasDefault: false }, mouseDownView: true, - zoom: { insertIndex: 1 }, - compass: { bottom: "toolbar", left: "5px" }, - distanceLegend: { left: "10px", bottom: "2px" }, - locationBar: { - fps: true, - crs: "CGCS2000_GK_Zone_3", - crsDecimal: 0, - template: - "
经度:{lng}
纬度:{lat}
横{crsx} 纵{crsy}
海拔:{alt}米
层级:{level}
方向:{heading}°
俯仰角:{pitch}°
视高:{cameraHeight}米
", - }, + zoom: { insertIndex: 1 }, // 保留缩放控件 + compass: false, // 隐藏指南针(2D不需要) + distanceLegend: false, // 隐藏距离图例 }, templateValues: { + // dataServer: "//data.mars3d.cn", + // gltfServerUrl: "//data.mars3d.cn/gltf", dataServer: "//data.mars3d.cn", gltfServerUrl: "//data.mars3d.cn/gltf", }, terrain: { - url: "//data.mars3d.cn/terrain", + // url: "//data.mars3d.cn/terrain", + // show: false, show: false, }, basemaps: [ @@ -111,57 +161,6 @@ const mapConfig = { { name: "注记", type: "tdt", layer: "vec_z" }, ], }, - { - pid: 10, - name: "高德影像", - type: "group", - icon: "../../../../img/mars-map-img/gaode_img.png", - layers: [ - { name: "底图", type: "gaode", layer: "img_d" }, - { name: "注记", type: "gaode", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "高德电子", - type: "gaode", - icon: "../../../../img/mars-map-img/gaode_vec.png", - layer: "vec", - }, - { - pid: 10, - name: "百度影像", - type: "group", - icon: "../../../../img/mars-map-img/bd-img.png", - layers: [ - { name: "底图", type: "baidu", layer: "img_d" }, - { name: "注记", type: "baidu", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "百度电子", - icon: "../../../../img/mars-map-img/bd-vec.png", - type: "baidu", - layer: "vec", - }, - { - pid: 10, - name: "腾讯影像", - icon: "../../../../img/mars-map-img/tencent_img.png", - type: "group", - layers: [ - { name: "底图", type: "tencent", layer: "img_d" }, - { name: "注记", type: "tencent", layer: "img_z" }, - ], - }, - { - pid: 10, - name: "腾讯电子", - icon: "../../../../img/mars-map-img/tencent_vec.png", - type: "tencent", - layer: "vec", - }, { pid: 10, name: "ArcGIS影像", @@ -232,7 +231,13 @@ function initData() { intLat = list[0].proLat ? list[0].proLat : list[0].lat; } } - initMap(list); + // initMap(list); + $(document).ready(function () { + // 延迟初始化,确保 DOM 已就绪 + setTimeout(() => { + initMap(list); + }, 300); + }); } } @@ -777,12 +782,21 @@ function saveData() { .getElementsByTagName("iframe")[0]; frameId.contentWindow.savePointData(JSON.stringify(points)); parent.layer.msg("保存成功", { icon: 1 }); + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } // 关闭页面 function closePage() { + destroyMap(); let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 parent.layer.close(index); //再执行关闭 } + +function destroyMap() { + if (window.mapInstance) { + window.mapInstance.destroy(); + window.mapInstance = null; + } +} 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 179f90c..7ac3066 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js +++ b/src/main/resources/static/js/basic/lineManagement/child/threeSpanFormTemp.js @@ -32,21 +32,21 @@ function setParams(params) { $("#crossPublicFields").hide(); $("#crossRailwayFields").hide(); crossLineFields(); - $('#setting').show(); + $("#setting").show(); break; case "cross-public": $("#crossLineFields").hide(); $("#crossPublicFields").show(); $("#crossRailwayFields").hide(); crossPublicFields(); - $('#setting').hide(); + $("#setting").hide(); break; case "cross-railway": $("#crossLineFields").hide(); $("#crossPublicFields").hide(); $("#crossRailwayFields").show(); crossRailwayFields(); - $('#setting').hide(); + $("#setting").hide(); break; } form.render(); @@ -321,17 +321,19 @@ function getThreeSpanById() { function (result) { layer.close(loadingMsg); if (result.code === 200) { - if(result.data && result.data.spanType){ - $('.span-type-option').eq(parseInt(result.data.spanType) - 1).trigger('click'); - if(result.data.spanType === '1'){ - $('.span-type-option').eq(1).hide(); - $('.span-type-option').eq(2).hide(); - }else if(result.data.spanType === '2'){ - $('.span-type-option').eq(0).hide(); - $('.span-type-option').eq(2).hide(); - }else if(result.data.spanType === '3'){ - $('.span-type-option').eq(0).hide(); - $('.span-type-option').eq(1).hide(); + if (result.data && result.data.spanType) { + $(".span-type-option") + .eq(parseInt(result.data.spanType) - 1) + .trigger("click"); + if (result.data.spanType === "1") { + $(".span-type-option").eq(1).hide(); + $(".span-type-option").eq(2).hide(); + } else if (result.data.spanType === "2") { + $(".span-type-option").eq(0).hide(); + $(".span-type-option").eq(2).hide(); + } else if (result.data.spanType === "3") { + $(".span-type-option").eq(0).hide(); + $(".span-type-option").eq(1).hide(); } } setFormData(result.data); @@ -469,20 +471,26 @@ function saveData(data) { // 组装经纬度数据 let tbSpanTowerList = []; - if (!pointsStr) { + if ( + !pointsStr && + $(".span-type-option.active").data("type") === "cross-line" + ) { return layer.msg("请配置跨越杆塔经纬度", { icon: 7 }); } - tbSpanTowerList = JSON.parse(pointsStr).map((item) => { - return { - id: item.id || null, - 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, - }; - }); + if ($(".span-type-option.active").data("type") === "cross-line") { + tbSpanTowerList = JSON.parse(pointsStr).map((item) => { + return { + id: item.id || null, + 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, + }; + }); + } + // for (let i = 1; i <= 4; i++) { // let lon = data[`crossTowerLongitude${i}`]; // let lat = data[`crossTowerLatitude${i}`]; diff --git a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js index 0715ec4..3e5eef5 100644 --- a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js +++ b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js @@ -1375,7 +1375,7 @@ function getLegendData(id) { innerHtml += `
- ${item.name} + ${item.name} ${item.value}
`; @@ -1610,24 +1610,24 @@ document.addEventListener("DOMContentLoaded", function () { const projectOverviewContent = document.querySelector( ".project-overview-content" ); - const projectOverviewPreviewBox = document.querySelector( - ".project-overview-preview-box" - ); - projectOverviewBox.addEventListener("mouseenter", function () { - if ( - projectOverviewContent.scrollHeight > - projectOverviewContent.clientHeight - ) { - projectOverviewPreviewBox.style.display = "block"; - projectOverviewPreviewBox.innerHTML = - projectOverviewContent.innerHTML; - } else { - projectOverviewPreviewBox.style.display = "none"; - projectOverviewPreviewBox.innerHTML = ""; - } - }); - projectOverviewBox.addEventListener("mouseleave", function () { - projectOverviewPreviewBox.style.display = "none"; - projectOverviewPreviewBox.innerHTML = ""; - }); + // const projectOverviewPreviewBox = document.querySelector( + // ".project-overview-preview-box" + // ); + // projectOverviewBox.addEventListener("mouseenter", function () { + // if ( + // projectOverviewContent.scrollHeight > + // projectOverviewContent.clientHeight + // ) { + // projectOverviewPreviewBox.style.display = "block"; + // projectOverviewPreviewBox.innerHTML = + // projectOverviewContent.innerHTML; + // } else { + // projectOverviewPreviewBox.style.display = "none"; + // projectOverviewPreviewBox.innerHTML = ""; + // } + // }); + // projectOverviewBox.addEventListener("mouseleave", function () { + // projectOverviewPreviewBox.style.display = "none"; + // projectOverviewPreviewBox.innerHTML = ""; + // }); }); diff --git a/src/main/resources/static/pages/basic/lineManagement/child/setLonAndLat.html b/src/main/resources/static/pages/basic/lineManagement/child/setLonAndLat.html index 822e3ed..f5c95b0 100644 --- a/src/main/resources/static/pages/basic/lineManagement/child/setLonAndLat.html +++ b/src/main/resources/static/pages/basic/lineManagement/child/setLonAndLat.html @@ -25,11 +25,11 @@ - + - - + + 配置索道口、中转口经纬度 diff --git a/src/main/resources/static/pages/synthesisQuery/digitalSignage.html b/src/main/resources/static/pages/synthesisQuery/digitalSignage.html index 9823f67..6a52430 100644 --- a/src/main/resources/static/pages/synthesisQuery/digitalSignage.html +++ b/src/main/resources/static/pages/synthesisQuery/digitalSignage.html @@ -111,8 +111,8 @@ -
-
+