浏览代码

视角定位

zpf 1 年之前
父节点
当前提交
cb75deb3b7
共有 2 个文件被更改,包括 20 次插入5 次删除
  1. 2 2
      src/views/cockpit/tdsy.vue
  2. 18 3
      src/views/viewer.vue

+ 2 - 2
src/views/cockpit/tdsy.vue

@@ -543,9 +543,9 @@ export default {
 
       if (this.left_value == 'hysyq') {
         this.right_options = [
-          { value: "gyjd", label: "供应进度" },
+          { value: "gyjg", label: "供应结构" },
         ]
-        this.right_value = 'gyjd'
+        this.right_value = 'gyjg'
       } else {
         this.right_options = [
           { value: "gyjd", label: "供应进度" },

+ 18 - 3
src/views/viewer.vue

@@ -83,13 +83,27 @@ export default {
     //监控data中的数据变化
     watch: {
 
-        isViewer_flag(newVal, oldVal) { 
+        isViewer_flag(newVal, oldVal) {
             cockpit.hidden_xzqh(newVal);
             cockpit.hidden_wall(newVal);
-         },
+            if (newVal) {
+                viewer.camera.flyTo({ //定位到范围中心点
+                    destination: {
+                        x: -2040463.7901390342,
+                        y: 5793227.819015942,
+                        z: 1894583.1762108966
+                    },
+                    orientation: {
+                        heading: 0.000005686606919574899,
+                        pitch: -0.41034310444770905,
+                        roll: 0.0
+                    },
+                })
+            }
+        },
 
         isxzqh_flag(newVal, oldVal) {
-            
+
             cockpit.hidden_xzqh(newVal);
             cockpit.hidden_wall(newVal);
 
@@ -222,6 +236,7 @@ export default {
                 }
                 if (store.state.xzqh_flag) {
                     if (Cesium.defined(pickObj)) {
+                        console.log(store.state.xzqh_flag, "store.state.xzqh_flag");
                         if (pickObj.primitive instanceof Cesium.Primitive && store.state.xzqh_flag == true) {//点击primitive
                             //primitive相关操作