shuishen
2022-01-07 b41fcb58025473d83c41bca06f546d62fd8a908b
src/store/modules/mobile.js
@@ -45,6 +45,8 @@
    tilesetLayer: null, //2.5d模型
    usetowpointfive: null,
    tilesetLayer: null, //瀑布流
    audioData: null, //语音
  },
  mutations: {
    MSET_VIEWER(state, viewer) {
@@ -134,13 +136,13 @@
        // state.mviewer.flyTo(state.tileset);
        //3D视角不限制
        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 100;
        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80;
        // 最大
        state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000000;
        // 设置相机缩小时的速率
        state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 3000;
        state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 10000;
        // 设置相机放大时的速率
        state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 3000;
        state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000;
        // 视角平移
        state.mviewer.scene.screenSpaceCameraController.enableRotate = true;
        // 视角缩放
@@ -156,7 +158,7 @@
        };
        state.tilesetLayer.show = false; //隐藏3d图形
        state.newLayer = state.usetowpointfive(); //添加2.5d图形贴片
        state.wallLayer.show = true; //打开瀑布
        state.wallLayer.show = false; //打开瀑布
        state.startPointFn(); //移动默认视角
        //2.5D视角限制
@@ -300,7 +302,11 @@
      if (!state.MobileWindowsHide && state.popupsDom) {
        state.popupsDom.closeOur();
        commit("MSET_MOBILEWINDOWSHIDE", true);
      }
        if (state.audioData) {
          state.audioData = null;
          window.speechSynthesis.cancel();
        }
      } //cancel
    },
    CHANGETOC3({ state, commit }, data) {
      // //转换经纬度坐标 成世界坐标cartesian3
@@ -483,6 +489,16 @@
        },
      });
    },
    MSET_GETAUDIO({ state, commit, dispatch }, val) {
      if (state.audioData) {
        state.audioData = null;
        window.speechSynthesis.cancel();
      } else {
        state.audioData = new window.SpeechSynthesisUtterance();
        state.audioData.text = val;
        window.speechSynthesis.speak(state.audioData);
      }
    },
  },
};