浏览代码

修改定位

wdq 7 月之前
父节点
当前提交
41dd4f7628
共有 2 个文件被更改,包括 10 次插入13 次删除
  1. 9 12
      src/components/Map.vue
  2. 1 1
      src/store/index.js

+ 9 - 12
src/components/Map.vue

@@ -120,13 +120,18 @@ export default {
             that.loadTheWorldMapImage(url);
           });
           viewer.camera.setView({
-            destination: SkyScenery.Cartesian3.fromDegrees(121, 31, 30000.0), // 设置位置
+            destination: SkyScenery.Cartesian3.fromDegrees(
+              121.29818074250946,
+              31.11623998465621,
+              7538.855340945846
+            ), // 设置位置
             orientation: {
-              heading: SkyScenery.Math.toRadians(0.0), // 方向
-              pitch: SkyScenery.Math.toRadians(-90.0), // 倾斜角度
-              roll: 0
+              heading: SkyScenery.Math.toRadians(356.03124515798294), // 方向
+              pitch: SkyScenery.Math.toRadians(-45.31422437550821), // 倾斜角度
+              roll: SkyScenery.Math.toRadians(0.0047792745453184024)
             }
           });
+
           this.$store.commit("createdMap", true);
           // // 盘龙天地
           // let tileName = "盘龙天地";
@@ -271,14 +276,6 @@ export default {
             "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
         })
       );
-      viewer.camera.setView({
-        destination: SkyScenery.Cartesian3.fromDegrees(121, 31, 30000.0), // 设置位置
-        orientation: {
-          heading: SkyScenery.Math.toRadians(0.0), // 方向
-          pitch: SkyScenery.Math.toRadians(-90.0), // 倾斜角度
-          roll: 0
-        }
-      });
     },
 
     // 加载geojson数据

+ 1 - 1
src/store/index.js

@@ -2,7 +2,7 @@ import { createStore } from 'vuex'
 
 export default createStore({
   state: {
-    initMap: false
+    initMap: false,
   },
   getters: {
   },