From 087510aa88b0a6b6b5c648907e9dd52394621d47 Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期二, 07 五月 2024 10:57:39 +0800
Subject: [PATCH] 代码更新

---
 src/assets/js/tool/configTool.js |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/assets/js/configTool.js b/src/assets/js/tool/configTool.js
similarity index 65%
rename from src/assets/js/configTool.js
rename to src/assets/js/tool/configTool.js
index dfbbe4c..8132583 100644
--- a/src/assets/js/configTool.js
+++ b/src/assets/js/tool/configTool.js
@@ -2,11 +2,11 @@
   time: 5,
   setMapFly(res) {
     var that = this;
-
+    const alt = res.alt == 0 ? 100 : res.alt;
     //璁剧疆鍒濆瑙嗗浘浣嶇疆
     Viewer.camera.flyTo({
       // fromDegrees()鏂规硶锛屽皢缁忕含搴﹀拰楂樼▼杞崲涓轰笘鐣屽潗鏍�
-      destination: Cesium.Cartesian3.fromDegrees(res.lon, res.lat, res.alt),
+      destination: Cesium.Cartesian3.fromDegrees(res.lon, res.lat, alt),
       orientation: {
         // 鏂瑰悜
         heading: res.heading,
@@ -22,6 +22,23 @@
   getNewDateTime() {
     return new Date().getTime();
   },
+  getEndDateTime() {
+    return this.getNewDateTime() + 3600 * 2;
+  },
+  //鐐瑰嚮鑾峰彇缁忕含搴�
+  getViewerPosition(res) {
+    const cartesain = Viewer.camera.pickEllipsoid(res.position);
+    var cartographic = Cesium.Cartographic.fromCartesian(cartesain);
+    return {
+      lon: parseFloat(Cesium.Math.toDegrees(cartographic.longitude)).toFixed(6),
+      lat: parseFloat(Cesium.Math.toDegrees(cartographic.latitude)).toFixed(6),
+      alt: cartographic.height,
+      heading: Viewer.scene.camera.heading,
+      pitch: Viewer.scene.camera.pitch,
+      roll: Viewer.scene.camera.roll,
+    };
+  },
+  //鑾峰彇褰撳墠瑙嗚淇℃伅
   getViewerCamera() {
     var position = Viewer.scene.camera.positionCartographic;
     return {

--
Gitblit v1.9.3