月球大数据地理空间分析展示平台-【前端】-月球2期前端
surprise
2023-10-19 bfe436e493006bea75d32383d6bdfc0af8c7e5d0
src/assets/js/Map/index.js
@@ -15,6 +15,7 @@
    SmartEarth.Cesium.ExternalParameter.maxTerrainHeight = 2000000;
    SmartEarth.Cesium.ExternalParameter.minTerrainHeight = -2000000;
    SmartEarth.Cesium.ShadowMap.MAXIMUM_DISTANCE = 20000000000;
    SmartEarth.Cesium.ExternalParameter.ellipsoidCoordinates = 'MOON2000'
    window.Cesium = SmartEarth.Cesium;
    SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(
      1737400.0,
@@ -22,15 +23,19 @@
      1737400.0
    );
    //页面初始化
    this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", {
      StaticFileBaseUrl: config.StaticFileBaseUrl,
      ellipsoidCoordinates: "MOON2000",
      ellipsoidCoordinates: 'MOON2000',
      timeline: true,
    });
    this.earthCtrl.Viewer.scene.debugShowFramesPerSecond = true;
    this.earthCtrl.Viewer.scene.debugShowFramesPerSecond = true
    this.earthCtrl.coreMap.scene.screenSpaceCameraController.enableCollisionDetection = true;
    this.earthCtrl.Viewer.scene.globe.terrainExaggeration = 1.00001
    window.earthCtrl = this.earthCtrl;
@@ -44,7 +49,10 @@
    sgworld.Creator.SimpleGraphic.edit(true, { editProp: false });
    //=======================
    // window.Viewer.imageryLayers.removeAll();
    //设置球体颜色
    window.Viewer.scene.globe.baseColor = new Cesium.Color.fromCssColorString('#A9A9A9');
    //清除所有默认图层
    window.Viewer.imageryLayers.removeAll();
    window.setLayer();
    Viewer.scene.globe.depthTestAgainstTerrain = false; // 开启深度测试
@@ -76,16 +84,19 @@
      if (Cesium.defined(cartesian)) {
        if (cartesian.id.shpType && cartesian.id.shpType == 'temporaryLayer') {
          that.setEditTemporaryLayer()
          that.setEditTemporaryLayer(cartesian.id._id)
        }
      }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  },
  setEditTemporaryLayer(res) {
    // store.state.editTemporaryId = res;
    // console.log(store.state.editTemporaryId)
    if (store.state.editTemporaryId) {
    if (store.state.editTemporaryId && store.state.editTemporaryId  == res) {
      store.state.setEditTemporaryShow = true;
    }
  },