From 1d0db2268bc114753f1f2b0fce056cfbaf519a64 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 10 十月 2023 11:06:22 +0800 Subject: [PATCH] 代码更新 --- src/components/map/viewer.vue | 35 +++++++++++++++-------------------- 1 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue index 602266b..f010d28 100644 --- a/src/components/map/viewer.vue +++ b/src/components/map/viewer.vue @@ -1,13 +1,9 @@ <template> <div> <div id="sdkContainer"></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 style="z-index: 30;position: absolute; top:1%;left: 1%;"> + <el-button @click="setLocation(3)">婕父</el-button> + </div> --> </div> </template> @@ -19,9 +15,6 @@ 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; @@ -48,21 +41,20 @@ 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 = { fullscreenButton: true, licenseServer: "http://183.162.245.49:18080", minViewHeight: parseFloat(common.minviewheight), - // url: SmartEarthRootUrl + "Workers/image/earth.jpg", //涓嶅惈鍗曞紶鍦板浘鍥剧墖url鍒欎娇鐢ㄥ湪绾垮湴鍥� + url: SmartEarthRootUrl + "Workers/image/earth.jpg", //涓嶅惈鍗曞紶鍦板浘鍥剧墖url鍒欎娇鐢ㄥ湪绾垮湴鍥� contextOptions: { failIfMajorPerformanceCaveat: false, webgl: { @@ -113,18 +105,21 @@ // duration: 8, //椋炶鏃堕棿8s // }); // }, 10000); - var data = mapData.mapRest setTimeout(() => { sgworld.Navigate.flyToPointsInterest({ - destination: { 'x': data.lng, 'y': data.lat, 'z': data.alt }, + destination: { + "x": -2187108.231948378, + "y": 4392040.442348233, + "z": 4063265.829085007 + }, orientation: { - heading: data.heading, - pitch: data.pitch, - roll: data.roll, + heading: 2.4384163743219607, + pitch: -0.32733173444759833, + roll: 6.283095595698651, }, duration: 10, //椋炶鏃堕棿8s }); - }, 9000); + }, 1000); that.setCesiumInit(true); // rpc.initRpc(); } @@ -141,7 +136,7 @@ //鍦颁笅妯″紡璺濈鍙傛暟 Viewer.scene.globe.translucency.frontFaceAlpha = 0.5; Viewer.scene.globe.undergroundColor = undefined; - mapMsg.init(); + rpc.initMessage(); rpc.clickToCoordinates(); //鏍囦細缂栬緫 -- Gitblit v1.9.3