From 082613d446e29e4ec1c16bfaa52345106a498b23 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 08 Nov 2022 09:03:49 +0800
Subject: [PATCH] 农事操作隐藏后四个,地图模式2d改为3d

---
 src/components/map/plotMap.vue |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/components/map/plotMap.vue b/src/components/map/plotMap.vue
index 06b4e6e..d2134de 100644
--- a/src/components/map/plotMap.vue
+++ b/src/components/map/plotMap.vue
@@ -51,7 +51,6 @@
                         preserveDrawingBuffer: true
                     }
                 },
-                sceneMode: 2
             })
 
             farmRegionLayer = new global.DC.VectorLayer('farmRegionLayer')
@@ -234,7 +233,12 @@
         getDetail(this.$farmId).then(res=>{
             this.farm.latitude = res.data.data.latitude
             this.farm.longitude = res.data.data.longitude
-            global.DC.ready(initViewer(this.farm.latitude,this.farm.longitude))
+            // global.DC.ready(initViewer(this.farm.latitude,this.farm.longitude))
+
+            global.DC.ready(() => {
+                initViewer(this.farm.latitude,this.farm.longitude)
+            })
+
             this.addRegionPolyLine(NCregion)
         })
     },
@@ -341,23 +345,25 @@
                 // })
                 // farmLogoLayer.addOverlay(divIcon)
             }
-            const polygon = new global.DC.Polygon(positions)
-            polygon.attrParams = item
-            polygon.setStyle({
-                material: global.DC.Namespace.Cesium.Color.fromBytes(
-                    129, 255, 84,
-                    200
-                )
-            })
+            if(positions){
+                const polygon = new global.DC.Polygon(positions)
+                polygon.attrParams = item
+                polygon.setStyle({
+                    material: global.DC.Namespace.Cesium.Color.fromBytes(
+                        129, 255, 84,
+                        200
+                    )
+                })
 
-            polygon.on(global.DC.MouseEventType.CLICK, (e) => {
-                that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
-                that.drawLandPolyLine(positions)
-            })
+                polygon.on(global.DC.MouseEventType.CLICK, (e) => {
+                    that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
+                    that.drawLandPolyLine(positions)
+                })
 
 
-            plotRegionLayer.addOverlay(polygon)
-            addPlotLayers.push({ center, name: item.landName, id: item.id })
+                plotRegionLayer.addOverlay(polygon)
+                addPlotLayers.push({ center, name: item.landName, id: item.id })
+            }
         },
         /**
          * 地块画线
@@ -438,6 +444,7 @@
 
             // 根据坐标画线
             const positions = this.setPositionByLandRange(landObj.landRange)
+          console.log(positions,123455555)
             if (positions) {
                 this.drawLandPolyLine(positions)
             }

--
Gitblit v1.9.3