From 263bf9730455a7bcc4fdc6471f8f9d0c96e47c9e Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期一, 14 七月 2025 16:13:51 +0800 Subject: [PATCH] 添加经纬度高度 --- src/views/left/KGSimOption/PredictiveSimulation.vue | 22 ++++++++++- src/views/left/CitySim.vue | 22 ++++++++++- src/views/left/KGSimOption/RealTimeSimulation.vue | 22 ++++++++++- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/views/left/CitySim.vue b/src/views/left/CitySim.vue index a4de983..d2d01ac 100644 --- a/src/views/left/CitySim.vue +++ b/src/views/left/CitySim.vue @@ -196,7 +196,7 @@ } await simStore.addSimCheme(forms); // 鎵撳嵃鎷︽尅鍧濇墍闇�瑕佺殑鏁版嵁 - // printDamEntities(); + printDamEntities(); resetForm(); // 鍙湁鍦ㄤ繚瀛樻垚鍔熷悗鎵嶉噸缃〃鍗� EventBus.emit("close-selectArea"); } catch (error) { } @@ -655,9 +655,26 @@ const entity = entities[i]; if (entity.name && (entity.name === '鏍忔。鍧�1' || entity.name === '鏍忔。鍧�2')) { + let position = entity.position?._value; + + // 濡傛灉鏈変綅缃俊鎭紝灏卞皢鍏朵粠绗涘崱灏斿潗鏍囪浆涓虹粡绾害鍜岄珮搴� + let cartographic = undefined; + if (position) { + cartographic = Cesium.Cartographic.fromCartesian(position); + } + damDataList.push({ name: entity.name, - position: entity.position?._value, + position: position ? { + x: position.x, + y: position.y, + z: position.z + } : null, + cartographic: cartographic ? { + longitude: Cesium.Math.toDegrees(cartographic.longitude), // 缁忓害锛堝害锛� + latitude: Cesium.Math.toDegrees(cartographic.latitude), // 绾害锛堝害锛� + height: cartographic.height // 楂樺害锛堢背锛� + } : null, heading: entity.heading?._value ?? entity.heading, pitch: entity.pitch?._value ?? entity.pitch, roll: entity.roll?._value ?? entity.roll, @@ -665,6 +682,7 @@ }); } } + if (damDataList.length > 0) { console.log("銆愭爮妗e潩瀹炰綋鏁版嵁鍒楄〃銆戯細", damDataList); deleteDamEntitiesAfterDelay(); diff --git a/src/views/left/KGSimOption/PredictiveSimulation.vue b/src/views/left/KGSimOption/PredictiveSimulation.vue index 045f132..cfa7ca6 100644 --- a/src/views/left/KGSimOption/PredictiveSimulation.vue +++ b/src/views/left/KGSimOption/PredictiveSimulation.vue @@ -254,11 +254,11 @@ // 鎵撳紑淇濆瓨鏂规瀵硅瘽妗� const openSaveDialog = async () => { // 鍦� setup 鍐呴儴鏇存柊 geom 鐨勫�� + printDamEntities(); try { forms.geom = props.selectedArea; await simStore.addSimCheme(forms); // 鎵撳嵃鎷︽尅鍧濇墍闇�瑕佺殑鏁版嵁 - // printDamEntities(); resetForm(); EventBus.emit("close-selectArea"); } catch (err) {} @@ -316,9 +316,26 @@ const entity = entities[i]; if (entity.name && (entity.name === '鏍忔。鍧�1' || entity.name === '鏍忔。鍧�2')) { + let position = entity.position?._value; + + // 濡傛灉鏈変綅缃俊鎭紝灏卞皢鍏朵粠绗涘崱灏斿潗鏍囪浆涓虹粡绾害鍜岄珮搴� + let cartographic = undefined; + if (position) { + cartographic = Cesium.Cartographic.fromCartesian(position); + } + damDataList.push({ name: entity.name, - position: entity.position?._value, + position: position ? { + x: position.x, + y: position.y, + z: position.z + } : null, + cartographic: cartographic ? { + longitude: Cesium.Math.toDegrees(cartographic.longitude), // 缁忓害锛堝害锛� + latitude: Cesium.Math.toDegrees(cartographic.latitude), // 绾害锛堝害锛� + height: cartographic.height // 楂樺害锛堢背锛� + } : null, heading: entity.heading?._value ?? entity.heading, pitch: entity.pitch?._value ?? entity.pitch, roll: entity.roll?._value ?? entity.roll, @@ -326,6 +343,7 @@ }); } } + if (damDataList.length > 0) { console.log("銆愭爮妗e潩瀹炰綋鏁版嵁鍒楄〃銆戯細", damDataList); deleteDamEntitiesAfterDelay(); diff --git a/src/views/left/KGSimOption/RealTimeSimulation.vue b/src/views/left/KGSimOption/RealTimeSimulation.vue index 288a377..0f0815a 100644 --- a/src/views/left/KGSimOption/RealTimeSimulation.vue +++ b/src/views/left/KGSimOption/RealTimeSimulation.vue @@ -211,7 +211,7 @@ formData.geom = props.selectedArea; await simAPIStore.addSimCheme(formData); // 鎵撳嵃鎷︽尅鍧濇墍闇�瑕佺殑鏁版嵁 - // printDamEntities(); + printDamEntities(); resetForm(); EventBus.emit("close-selectArea"); } catch (err) {} @@ -416,9 +416,26 @@ const entity = entities[i]; if (entity.name && (entity.name === '鏍忔。鍧�1' || entity.name === '鏍忔。鍧�2')) { + let position = entity.position?._value; + + // 濡傛灉鏈変綅缃俊鎭紝灏卞皢鍏朵粠绗涘崱灏斿潗鏍囪浆涓虹粡绾害鍜岄珮搴� + let cartographic = undefined; + if (position) { + cartographic = Cesium.Cartographic.fromCartesian(position); + } + damDataList.push({ name: entity.name, - position: entity.position?._value, + position: position ? { + x: position.x, + y: position.y, + z: position.z + } : null, + cartographic: cartographic ? { + longitude: Cesium.Math.toDegrees(cartographic.longitude), // 缁忓害锛堝害锛� + latitude: Cesium.Math.toDegrees(cartographic.latitude), // 绾害锛堝害锛� + height: cartographic.height // 楂樺害锛堢背锛� + } : null, heading: entity.heading?._value ?? entity.heading, pitch: entity.pitch?._value ?? entity.pitch, roll: entity.roll?._value ?? entity.roll, @@ -426,6 +443,7 @@ }); } } + if (damDataList.length > 0) { console.log("銆愭爮妗e潩瀹炰綋鏁版嵁鍒楄〃銆戯細", damDataList); deleteDamEntitiesAfterDelay(); -- Gitblit v1.9.3