From a77448eb072f10dd3827694140f87c3069b1dba4 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期六, 07 十月 2023 11:14:40 +0800
Subject: [PATCH] 代码更新

---
 src/components/map/viewer.vue |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue
index 15c94bf..0a975b3 100644
--- a/src/components/map/viewer.vue
+++ b/src/components/map/viewer.vue
@@ -1,9 +1,13 @@
 <template>
   <div>
     <div id="sdkContainer"></div>
-    <!-- <div style="z-index: 30;position: absolute; top:1%;left: 1%;">
-      <el-button @click="setLocation(3)">婕父</el-button>
-    </div> -->
+    <!-- <div
+      id="msg"
+      style="min-width: 200px;min-height: 100px; z-index: 30;position: absolute; top:5%;left: 40%;background: skyblue;"
+    >
+      <label>{{ messagelayer }}</label>
+
+    </div>-->
   </div>
 </template>
 
@@ -15,6 +19,9 @@
 import { mapState, mapMutations } from "vuex";
 import "animate.css";
 import rpc from "../../assets/js/rpc";
+import mapData from "../../../static/mapData";
+import mapMsg from "../../assets/js/mapMsg";
+import vueEvents from '@/utils/vueEvent.js'
 let PoiLayerConstructor = Vue.extend(poiLayer);
 
 let handler;
@@ -41,13 +48,14 @@
       locationPoint: null,
       locationInstance: null,
       locationData: null,
+      messagelayer: null
     };
   },
   computed: {
     ...mapState(["cesiumInit"]),
   },
   mounted() {
-
+    vueEvents.$on('messagelayer', (res) => { this.messagelayer = JSON.stringify(res) })
     this.$nextTick(function () {
       let that = this;
       let option = {
@@ -105,21 +113,18 @@
           //     duration: 8, //椋炶鏃堕棿8s
           //   });
           // }, 10000);
+          var data = mapData.mapRest
           setTimeout(() => {
             sgworld.Navigate.flyToPointsInterest({
-              destination: {
-                "x": -2187108.231948378,
-                "y": 4392040.442348233,
-                "z": 4063265.829085007
-              },
+              destination: { 'x': data.lng, 'y': data.lat, 'z': data.alt },
               orientation: {
-                heading: 2.4384163743219607,
-                pitch: -0.32733173444759833,
-                roll: 6.283095595698651,
+                heading: data.heading,
+                pitch: data.pitch,
+                roll: data.roll,
               },
               duration: 10, //椋炶鏃堕棿8s
             });
-          }, 1000);
+          }, 10000);
           that.setCesiumInit(true);
           // rpc.initRpc();
         }
@@ -136,7 +141,7 @@
       //鍦颁笅妯″紡璺濈鍙傛暟
       Viewer.scene.globe.translucency.frontFaceAlpha = 0.5;
       Viewer.scene.globe.undergroundColor = undefined;
-      rpc.initMessage();
+      mapMsg.init();
       rpc.clickToCoordinates();
 
       //鏍囦細缂栬緫

--
Gitblit v1.9.3