shuishen
2022-02-15 5cf33b2b4217dbe50e7fa0599e09e0ee8ae63db4
src/store/modules/mobile.js
@@ -75,6 +75,7 @@
    drawALineLayerMany: null, //活动路线图层
    drawAPointLayerMany: null, //活动点图层
    isOpenDrawALineMany: null, //是否开启活动
    seeRight: true, //右侧控制栏显影
  },
  mutations: {
    MSET_VIEWER(state, viewer) {
@@ -203,11 +204,15 @@
        // 视角旋转
        state.mviewer.scene.screenSpaceCameraController.enableTilt = true;
      } else if (data == "2.5D") {
        console.log("2.5");
        state.dimensionData = {
          // 维度镜头数据
          heading: 0,
          pitch: -90,
          roll: 0,
          // heading: global.DC.Namespace.Cesium.Math.toRadians(-9),
          // pitch: global.DC.Namespace.Cesium.Math.toRadians(-34.54),
          // roll: 0,
        };
        //取消3D底图
        state.mviewer.imageryLayers.remove(state.vecLayer);
@@ -220,11 +225,11 @@
        state.startPointFn(); //移动默认视角
        state.areaLayer.show = true; //绿布
        //2.5D视角限制
        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 0;
        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80;
        // 最大
        state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000;
        state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 200;
        // 设置相机缩小时的速率
        // state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 30000;
        state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 2000;
        // 设置相机放大时的速率
        state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000;
        // 视角平移
@@ -331,6 +336,9 @@
      state.select.overlay = data[0];
      state.select.color = data[1];
    },
    SET_SeeAndNotSee(state, data) {
      state.seeRight = data;
    },
  },
  actions: {
    MSET_CREADE({ state, commit, dispatch }) {
@@ -430,8 +438,24 @@
        0,
        state.dimensionData.pitch
      );
      if (!state.MobileWindowsHide) {
        //关闭弹窗
        commit("MSET_MOBILEWINDOWSHIDE", true);
      }
      if (
        state.select.overlay != undefined &&
        data.query.fromTo != "mapClick"
      ) {
        //关闭绿色边框
        state.select.overlay.setStyle({
          material: state.select.color,
          outline: false,
        });
        commit("mset_changeSelect", [undefined, undefined]);
      }
      // console.log(state.dimension);
      if (state.dimension != "2.5D") {
        // if (true) {
        // if (true) {
        dispatch("mapFlyTo", {
          //飞入
@@ -441,34 +465,41 @@
          roll: Position.roll,
        });
      } else {
        state.mviewer.camera.setView({
          // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
          // fromDegrees()方法,将经纬度和高程转换为世界坐标
          destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
            // 114.0351,
            // 27.6314,
            // 200.0
            Position.lng - 0.012,
            Position.lat,
            Position.alt || 15000.0
          ),
          orientation: {
            heading: global.DC.Namespace.Cesium.Math.toRadians(
              Position.heading
            ),
            pitch: global.DC.Namespace.Cesium.Math.toRadians(Position.pitch),
            // heading: data.heading,
            // pitch: data.pitch,
            roll: Position.roll,
          },
        dispatch("mapFlyTo", {
          //飞入
          lntLat: [Position.lng, +Position.lat - 0.0003, 160],
          heading: Position.heading,
          pitch: Position.pitch,
          roll: Position.roll,
        });
        commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
        // state.mviewer.camera.setView({
        //   // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
        //   // fromDegrees()方法,将经纬度和高程转换为世界坐标
        //   destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
        //     // 114.0351,
        //     // 27.6314,
        //     // 200.0
        //     Position.lng - 0.012,
        //     Position.lat - 0.0003,
        //     Position.alt || 15000.0
        //   ),
        //   orientation: {
        //     heading: global.DC.Namespace.Cesium.Math.toRadians(
        //       Position.heading
        //     ),
        //     pitch: global.DC.Namespace.Cesium.Math.toRadians(Position.pitch),
        //     // heading: data.heading,
        //     // pitch: data.pitch,
        //     roll: Position.roll,
        //   },
        // });
        // commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
      }
      // })
      commit("MSET_POPUPDOM", popupsDom);
    },
    closeMobileWindowsDom({ state, commit, dispatch }) {
      commit("CLOSE_NOWPOSITION");//中断定位获取
      commit("CLOSE_NOWPOSITION"); //中断定位获取
      if (!state.MobileWindowsHide && state.popupsDom) {
        state.popupsDom.closeOur();
        commit("MSET_MOBILEWINDOWSHIDE", true);
@@ -536,7 +567,7 @@
            // 自定义回调
            setTimeout(() => {
              data.fn();
            }, 500);
            }, 200);
          }
          if (!data.noOpen) {
            setTimeout(() => {
@@ -794,7 +825,8 @@
        commit("removerPolyLineIcon");
        state.drawALineLayerIcon = new global.DC.VectorLayer("pointLayer");
        state.mviewer.addLayer(state.drawALineLayerIcon);
        let post = Str.split(";")[0].split(",");
        let useStr = Str.split(";");
        let post = useStr[useStr.length - 1].split(",");
        let position = new global.DC.Position(post[0], post[1]);
        let billboard = new global.DC.Billboard(
          position,