From 722dbde665a8e335bccaa9d984cd02eb22333e54 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Sat, 05 Mar 2022 17:49:13 +0800
Subject: [PATCH] +新增标签,可编辑,可加图片

---
 src/store/modules/mobile.js |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index eaa7fb9..9af0c5d 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -41,6 +41,8 @@
       pitch: -90,
       roll: 0,
     },
+    zoomRange: [80, 200], //缩放程度
+    frislayertHeight: 160, //默认弹窗高度
     perspectiveControl: "", //视角控制:高度、角度  ()=>{}
     perspectiveControls: "", //视角控制:高度、角度  ()=>{}
 
@@ -143,6 +145,14 @@
     //         state[state.pointLayerData.layer].show = false
     //     }
     // },
+    //送入移动端缩放范围
+    set_zoomRange(state, data) {
+      state.zoomRange = data;
+    },
+    //送入默认弹窗高度
+    set_frislayertHeight(state, data) {
+      state.frislayertHeight = data;
+    },
     //切换2D和2.5D
     MSET_DIMENSION(state, data) {
       //关闭弹窗
@@ -254,9 +264,9 @@
         state.startPointFn(); //移动默认视角
         state.areaLayer.show = true; //绿布
         //2.5D视角限制
-        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80;
+        state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0];
         // 最大
-        state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 200;
+        state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1];
         // 设置相机缩小时的速率
         state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 2000;
         // 设置相机放大时的速率
@@ -389,6 +399,8 @@
       const nowHeight = Math.ceil(
         state.mviewer.camera.positionCartographic.height
       );
+      // 传递响应数据
+      commit("MSET_QUERY", data);
       // console.log(data);
       if (state.dimension == "3D") {
         Flys = [
@@ -411,7 +423,7 @@
           +data.lntLat[1] + 0.00048,
           // +data.lntLat[1] - 0.0022,
           // nowHeight,
-          360,
+          state.frislayertHeight,
         ];
         // console.log(nowHeight);
         clas = [
@@ -434,8 +446,7 @@
         );
         data.position = ellipsoid.cartographicToCartesian(cartographic);
       }
-      // 传递响应数据
-      commit("MSET_QUERY", data);
+
       // 定制化窗体
       const popupsDom = new global.DC.mobileDivForms(state.mviewer, {
         domId: "mobilePopup",
@@ -505,7 +516,7 @@
       } else {
         dispatch("mapFlyTo", {
           //飞入
-          lntLat: [Position.lng, +Position.lat - 0.0003, 160],
+          lntLat: [Position.lng, +Position.lat - 0.0003, Position.alt],
           heading: Position.heading,
           pitch: Position.pitch,
           roll: Position.roll,
@@ -632,7 +643,7 @@
               // dispatch("MSET_POINTDATA", data.lntLat);//传入标记点
               !state.MobileWindowsHide ||
                 commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
-            }, 0);
+            }, 100);
           }
         },
       });

--
Gitblit v1.9.3