月球大数据地理空间分析展示平台-【中台】
WX
2023-08-15 ea4a160fb6722dc98492fd7aff5b5a1ebeb06427
src/components/MapView/moonMap.vue
@@ -1,6 +1,7 @@
 <template>
  <div class="body_box">
    <div id="cesiumContainer"></div>
    <!-- <button id="btn1" class="layui-btn" @click="cameraInfo()">相机参数</button> -->
  </div>
</template>
@@ -15,6 +16,27 @@
    };
  },
  methods: {
     cameraInfo() {
            // 获取当前相机位置的xyz坐标
            var cameraPosition = Viewer.camera.position;
            // 获取当前相机的姿态(heading、pitch、roll)
            var cameraHeading = Viewer.camera.heading;
            var cameraPitch = Viewer.camera.pitch;
            var cameraRoll = Viewer.camera.roll;
            // 构建警报框中的消息
            var message = 'Camera Position (x, y, z):\n' +
                            cameraPosition.x.toFixed(2) + ', ' +
                            cameraPosition.y.toFixed(2) + ', ' +
                            cameraPosition.z.toFixed(2) + '\n\n' +
                            'Camera Heading: ' + cameraHeading.toFixed(2) + '\n' +
                            'Camera Pitch: ' + cameraPitch.toFixed(2) + '\n' +
                            'Camera Roll: ' + cameraRoll.toFixed(2);
            // 弹出警报框显示相机位置和姿态
            alert(message);
        },
    // wmts加载
    AddWmtesLayer(url, id) {
    var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({
@@ -80,7 +102,7 @@
      );
      //页面初始化
      this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
        // StaticFileBaseUrl: StaticFileBaseUrl,
        StaticFileBaseUrl: StaticFileBaseUrl,
        ellipsoidCoordinates: "MOON",
      });
      this.earthCtrl.environment.disableAllEffect();
@@ -98,8 +120,9 @@
      window.Cesium = SmartEarth.Cesium;
      window.sgworld = earthCtrl;
      sgworld.Navigate.Stop(); //取消飞行状态
      sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
      sgworld.Navigate.setPosition(-1093596.38, 5729026.12, 4136590.41);
      var token = getToken();
      var demUrl = `${BASE_URL}/proxy/${token}/24`
      var wmtsUrl = `${BASE_URL}/proxy/${token}/17`
@@ -118,6 +141,8 @@
      //   }),
      // });
      // window.Viewer.terrainProvider = terrain;
    },
  },
  mounted() {