From 2a7d64a6b667c059535eda3aca633d9f50da54d4 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期二, 03 六月 2025 09:44:06 +0800 Subject: [PATCH] dm change online3 --- src/components/menu/CrossSectionalAnalysis.vue | 112 +++++++++++++++++++++++++++++--------------------------- 1 files changed, 58 insertions(+), 54 deletions(-) diff --git a/src/components/menu/CrossSectionalAnalysis.vue b/src/components/menu/CrossSectionalAnalysis.vue index 284efa0..7aa8fc7 100644 --- a/src/components/menu/CrossSectionalAnalysis.vue +++ b/src/components/menu/CrossSectionalAnalysis.vue @@ -72,7 +72,9 @@ color: Cesium.Color.RED, outlineColor: Cesium.Color.YELLOW, outlineWidth: 2, - pixelSize: 8 // 鍦嗙偣鍗婂緞澶у皬 + pixelSize: 8,// 鍦嗙偣鍗婂緞澶у皬 + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000), + } }); pickedEntitiesIds.value.push(entity.id); // 璁板綍瀹炰綋ID @@ -85,6 +87,8 @@ positions: [startPoint.cartesian, endPoint.cartesian], material: Cesium.Color.YELLOW, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000), + } }); pickedEntitiesIds.value.push(entity.id); // 璁板綍瀹炰綋ID @@ -94,59 +98,59 @@ // 鏂板锛氱粯鍒舵ā鎷熺偣锛堝渾鏌� + label锛� function drawSimulationPoint(start, end) { -// 璁$畻涓偣锛堢粡绾害骞冲潎鍊硷級 -const midLon = (start.longitude + end.longitude) / 2; -const midLat = (start.latitude + end.latitude) / 2; -const terrainHeight = viewer.scene.globe.getHeight( - Cesium.Cartographic.fromDegrees(midLon, midLat) -); + // 璁$畻涓偣锛堢粡绾害骞冲潎鍊硷級 + const midLon = (start.longitude + end.longitude) / 2; + const midLat = (start.latitude + end.latitude) / 2; + const terrainHeight = viewer.scene.globe.getHeight( + Cesium.Cartographic.fromDegrees(midLon, midLat) + ); -const cylinderBottomHeight = 0; -const cylinderTopHeight = terrainHeight + 190; -const cartesianBottom = viewer.scene.globe.ellipsoid.cartographicToCartesian( - Cesium.Cartographic.fromDegrees(midLon, midLat, cylinderBottomHeight) -); -const CrosscylinderEntity = viewer.entities.add({ - position: cartesianBottom, - cylinder: { - length: 190.0, - topRadius: 1.0, - bottomRadius: 1.0, - material: Cesium.Color.YELLOW, - outline: true, - outlineColor: Cesium.Color.YELLOW, - slices: 64, - heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000) - } -}); -const labelHeight = cylinderTopHeight + 10; -const cartesianLabel = viewer.scene.globe.ellipsoid.cartographicToCartesian( - Cesium.Cartographic.fromDegrees(midLon, midLat, labelHeight) -); + const cylinderBottomHeight = 0; + const cylinderTopHeight = terrainHeight + 190; + const cartesianBottom = viewer.scene.globe.ellipsoid.cartographicToCartesian( + Cesium.Cartographic.fromDegrees(midLon, midLat, cylinderBottomHeight) + ); + const CrosscylinderEntity = viewer.entities.add({ + position: cartesianBottom, + cylinder: { + length: 190.0, + topRadius: 1.0, + bottomRadius: 1.0, + material: Cesium.Color.YELLOW, + outline: true, + outlineColor: Cesium.Color.YELLOW, + slices: 64, + heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000) + } + }); + const labelHeight = cylinderTopHeight + 10; + const cartesianLabel = viewer.scene.globe.ellipsoid.cartographicToCartesian( + Cesium.Cartographic.fromDegrees(midLon, midLat, labelHeight) + ); -const CrosslabelEntity = viewer.entities.add({ - position: cartesianLabel, - label: { - text: '鏂潰鎴潰妯℃嫙鐐�', - font: 'bold 14pt monospace', - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - fillColor: Cesium.Color.YELLOW, - outlineColor: Cesium.Color.BLACK, - outlineWidth: 2, - verticalOrigin: Cesium.VerticalOrigin.CENTER, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - backgroundColor: Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'), - backgroundPadding: new Cesium.Cartesian2(10, 10), - showBackground: true, - scale: 1, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000), - pixelOffsetScaleByDistance: new Cesium.NearFarScalar(100, 1.0, 5000, 0.3), - heightReference: Cesium.HeightReference.NONE // 浣跨敤缁濆楂樺害 - } -}); -pickedEntitiesIds.value.push(CrosscylinderEntity.id); -pickedEntitiesIds.value.push(CrosslabelEntity.id); + const CrosslabelEntity = viewer.entities.add({ + position: cartesianLabel, + label: { + text: '鏂潰鎴潰妯℃嫙鐐�', + font: 'bold 14pt monospace', + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + fillColor: Cesium.Color.YELLOW, + outlineColor: Cesium.Color.BLACK, + outlineWidth: 2, + verticalOrigin: Cesium.VerticalOrigin.CENTER, + horizontalOrigin: Cesium.HorizontalOrigin.CENTER, + backgroundColor: Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'), + backgroundPadding: new Cesium.Cartesian2(10, 10), + showBackground: true, + scale: 1, + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 5000), + pixelOffsetScaleByDistance: new Cesium.NearFarScalar(100, 1.0, 5000, 0.3), + heightReference: Cesium.HeightReference.NONE // 浣跨敤缁濆楂樺害 + } + }); + pickedEntitiesIds.value.push(CrosscylinderEntity.id); + pickedEntitiesIds.value.push(CrosslabelEntity.id); } function clearPoints() { for (const id of pickedEntitiesIds.value) { @@ -165,7 +169,7 @@ } isPicking.value = false; // isUploaded.value = false; - + ElMessage.info('宸插叧闂�--鏂潰鎴潰--鎷惧彇鐐瑰潗鏍囧姛鑳斤紒'); return; } @@ -208,7 +212,7 @@ cartesian: point2.cartesian }); - isUploaded.value = true; + isUploaded.value = true; ElMessage.success('姝e湪杩涜--鏂潰鎴潰--鏁版嵁鍒嗘瀽涓婁紶锛岃绋嶇瓑...'); } -- Gitblit v1.9.3