月球大数据地理空间分析展示平台-【中台】
WX
2023-08-15 da15329c0e7532231f567fc1c33ea8604f587350
src/components/MapView/moonMap.vue
@@ -5,6 +5,7 @@
</template>
<script>
import { getToken } from "../../utils/auth.js";
export default {
  components: {},
  data() {
@@ -14,6 +15,61 @@
    };
  },
  methods: {
    // wmts加载
    AddWmtesLayer(url, id) {
    var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({
      sourceType: "wmts",
      url: url,
      layer: "",
      format: "image/png",
      tileMatrixSetID: "GoogleCRS84Quad01",
      tileMatrixLabels: [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "10",
        "11",
        "12",
        "13",
        "14",
        "15",
        "16",
        "17",
        "18",
      ],
      style: "",
      tilingScheme: new Cesium.GeographicTilingScheme({
        ellipsoid: Cesium.Ellipsoid.MOON,
      }),
    });
    console.log(urlTemplateImageryProvider);
    // this.layerList.push({
    //   id: id,
    //   layerData: urlTemplateImageryProvider._primitive,
    //   type: "wmts",
    // });
  },
  // 地形加载
    AddDemLayer(url, id) {
    var terrain = new Cesium.CesiumTerrainProvider({
      url: url,
      // url: url,
      tilingScheme: new Cesium.GeographicTilingScheme({
        ellipsoid: Cesium.Ellipsoid.MOON,
      }),
    });
    window.Viewer.terrainProvider = terrain;
    // let img_layer = Viewer.imageryLayers.addImageryProvider(layer);
    // this.layerList.push({ id: id, type: "dem" });
  },
    //地图初始化
    init3DMap() {
      //设置月球坐标系
@@ -24,10 +80,10 @@
      );
      //页面初始化
      this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
        StaticFileBaseUrl: StaticFileBaseUrl,
        // StaticFileBaseUrl: StaticFileBaseUrl,
        ellipsoidCoordinates: "MOON",
      });
      // this.earthCtrl.environment.disableAllEffect();
      this.earthCtrl.environment.disableAllEffect();
      this.Viewer = this.earthCtrl._Viewer;
@@ -44,6 +100,12 @@
      window.sgworld = earthCtrl;
      sgworld.Creator.SimpleGraphic.edit(true, { editProp: true });
      var token = getToken();
      var demUrl = `${BASE_URL}/proxy/${token}/24`
      var wmtsUrl = `${BASE_URL}/proxy/${token}/17`
      this.AddDemLayer(demUrl)
      this.AddWmtesLayer(wmtsUrl)
      //=======================
      // window.Viewer.imageryLayers.removeAll();
      //=======================
@@ -77,4 +139,10 @@
    height: 100%;
  }
}
</style>
<style>
.cesium-viewer-animationContainer{
  display: none !important;
}
</style>