From 263bf9730455a7bcc4fdc6471f8f9d0c96e47c9e Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期一, 14 七月 2025 16:13:51 +0800 Subject: [PATCH] 添加经纬度高度 --- src/views/left/CitySim.vue | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 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(); -- Gitblit v1.9.3