From 4d0cece6f88fa97f5e299dc450d4707d3eec534e Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 18 Jan 2022 09:51:17 +0800
Subject: [PATCH] +

---
 src/components/map/components/dimension.vue |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/components/map/components/dimension.vue b/src/components/map/components/dimension.vue
index 51b97ea..630f1e1 100644
--- a/src/components/map/components/dimension.vue
+++ b/src/components/map/components/dimension.vue
@@ -28,7 +28,6 @@
             // 标注
             cvaLayer: null,
             // 建筑2.5D面数据
-            areaLayer: null,
             provider: null,
             wallLayer: null,
             tileset: null,
@@ -72,6 +71,7 @@
             ]
         }
     },
+    props: ['areaLayer'],
     computed: {
         ...mapGetters([
             'viewer',
@@ -270,7 +270,7 @@
                     //             })
                     //         }
                     //     })
-                    // }, 2400)
+                    // }, 1000)
                     that.titlesetLayerFlag = true
 
                     that.viewer.camera.setView({
@@ -290,10 +290,10 @@
                     // 最小
                     that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 200
                     // 最大
-                    that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 2400
+                    that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1000
 
                     // 设置相机缩小时的速率
-                    // that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 24000
+                    // that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 10000
                     // 设置相机放大时的速率
                     that.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                     // 视角平移
@@ -302,9 +302,6 @@
                     that.viewer.scene.screenSpaceCameraController.enableZoom = true
                     // 视角旋转
                     that.viewer.scene.screenSpaceCameraController.enableTilt = false
-
-                    that.areaLayer = new that.DC.VectorLayer('areaLayer')
-                    that.viewer.addLayer(that.areaLayer)
 
                     axios.get('http://arcgis.jxpskj.com:6080/arcgis/rest/services/lxxqwxq/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson').then(resultData => {
                         resultData.data.features.forEach(item => {
@@ -333,7 +330,7 @@
                     }
 
                     that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, e => {
-                        if (e.overlay != undefined) {
+                        if (e.overlay != undefined && e.layer.id == 'areaLayer') {
                             if (select.overlay != undefined) {
                                 if (e.overlay != select.overlay) {
                                     select.overlay.setStyle({
@@ -532,7 +529,7 @@
                 // 最小
                 that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 200
                 // 最大
-                that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 2400
+                that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 1000
                 // 视角旋转
                 that.viewer.scene.screenSpaceCameraController.enableTilt = false
             }
@@ -564,9 +561,9 @@
                     }
                 })
             };
-            if (height > 2400) {
+            if (height > 1000) {
                 that.viewer.camera.setView({
-                    destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(that.viewer.camera.positionCartographic.longitude, that.viewer.camera.positionCartographic.latitude, 2400),
+                    destination: that.DC.Namespace.Cesium.Cartesian3.fromRadians(that.viewer.camera.positionCartographic.longitude, that.viewer.camera.positionCartographic.latitude, 1000),
                     orientation: {
                         // 指向
                         heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),

--
Gitblit v1.9.3