From 23cba9212712bf0cbfc054810ff5bbe323334fd7 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sat, 08 Jan 2022 11:34:58 +0800
Subject: [PATCH] +

---
 src/components/mobileCortrolButtom/index.vue |   41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/src/components/mobileCortrolButtom/index.vue b/src/components/mobileCortrolButtom/index.vue
index 6724692..584f8a9 100644
--- a/src/components/mobileCortrolButtom/index.vue
+++ b/src/components/mobileCortrolButtom/index.vue
@@ -55,7 +55,7 @@
     };
   },
   computed: {
-    ...mapGetters(["mviewer", "openmobileGoTo"]),
+    ...mapGetters(["mviewer", "openmobileGoTo", "dimensionData"]),
   },
   created() {
     this.DC = global.DC;
@@ -69,19 +69,42 @@
     },
     handleCommand(command) {
       let that = this;
-      let position = [+command.lnt + 0.01197, +command.lat + 0.00048];
+      let position = [+command.lnt + 0.00027, +command.lat + 0.00048, 450];
       console.log(command, "定位");
       // 定位
       // this.$store.commit("MSETCC_SETCC", {
       //   lntLat: position,
       // });
-      this.$store.dispatch("mapFlyTo", {
-        //飞入
-        lntLat: [...position, 450],
-        heading: 0,
-        pitch: -90,
-        roll: 0,
-        noOpen: true,
+      // this.$store.dispatch("mapFlyTo", {
+      //   //飞入
+      //   lntLat: [...position, 450],
+      //   heading: 0,
+      //   pitch: -90,
+      //   roll: 0,
+      //   noOpen: true,
+      // });
+      that.mviewer.camera.setView({
+        // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
+        // fromDegrees()方法,将经纬度和高程转换为世界坐标
+        destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
+          // 114.0351,
+          // 27.6314,
+          // 200.0
+          position[0],
+          position[1],
+          position[2]
+        ),
+        orientation: {
+          heading: global.DC.Namespace.Cesium.Math.toRadians(
+            that.dimensionData.heading
+          ),
+          pitch: global.DC.Namespace.Cesium.Math.toRadians(
+            that.dimensionData.pitch
+          ),
+          // heading: data.heading,
+          // pitch: data.pitch,
+          roll: that.dimensionData.roll,
+        },
       });
     },
     openBigPopupAfter() {

--
Gitblit v1.9.3