liuyg
2022-03-25 7919b75636eaac4d3384a19d2db67df8a56b98cf
+屏蔽缩放
2 files modified
26 ■■■■ changed files
src/components/mobilemap/index.vue 11 ●●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 15 ●●●● patch | view | raw | blame | history
src/components/mobilemap/index.vue
@@ -134,6 +134,7 @@
      intervallayerNum: 15,
      frislayertHeight: 160, // 默认高度
      useSuofang: true, //是否缩放
    };
  },
  computed: {
@@ -296,6 +297,9 @@
        // const usMun = that.forlayerNum ? that.forlayerNum : that.threelayerNum;
        const usMun = that.sixlayerNum;
        if (window.height1s > usMun && isSet) {
          if (that.useSuofang) {
            return;
          }
          window.conBack(usMun);
        }
      });
@@ -321,6 +325,9 @@
      };
      window.butbut = function () {
        // return;
        if (that.useSuofang) {
          return;
        }
        // 放大
        document.querySelector(".dc-zoom-controller").children[0].onclick =
          function () {
@@ -472,6 +479,9 @@
        };
        var isCameraTime = null;
        global.viewer.on(global.DC.SceneEventType.CAMERA_CHANGED, (e) => {
          if (that.useSuofang) {
            return;
          }
          if (that.dimension == "2.5D") {
            // console.log(e);
            window.height4s = Math.ceil(
@@ -1050,6 +1060,7 @@
          that.onelayerNum,
          // that.forlayerNum ? that.forlayerNum : that.threelayerNum,
          that.sixlayerNum,
          that.useSuofang,
        ]); // 送入移动端缩放范围
        that.$store.commit("MSET_DIMENSION", "2.5D"); // 切换2.5D设置
      } else if (that.dimension == "3D") {
src/store/modules/mobile.js
@@ -334,10 +334,17 @@
                window.wallLayer.show = false // 打开瀑布
                window.startPointFn() // 移动默认视角
                window.areaLayer.show = true // 绿布
                // 2.5D视角限制
                global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0]
                // 最大
                global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1]
                if (state.zoomRange[2]) {
                    // 2.5D视角限制
                    // global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 50
                    // // 最大
                    // global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 9999999999
                } else {
                    // 2.5D视角限制
                    global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0]
                    // 最大
                    global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1]
                }
                // 设置相机缩小时的速率
                global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
                // 设置相机放大时的速率