From a75b44e4233b4914dddc878076c44b55b4083648 Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Wed, 24 Aug 2022 18:04:49 +0800
Subject: [PATCH] 点击地块显示白边

---
 src/components/map/index.vue |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/components/map/index.vue b/src/components/map/index.vue
index 4b39bbc..a4a9654 100644
--- a/src/components/map/index.vue
+++ b/src/components/map/index.vue
@@ -28,10 +28,16 @@
 
     data () {
         return {
-
+            polyline: null
         }
     },
-
+    watch: {
+        'polyline' (newObj,oldObj) {
+            if (newObj && oldObj) {
+                plotRegionLayer.removeOverlay(oldObj)
+            }
+        }
+    },
     computed: {
 
     },
@@ -322,12 +328,18 @@
             })
 
             polygon.on(global.DC.MouseEventType.CLICK, (e) => {
-                polygon.setStyle({
+
+                // 画线
+                this.polyline = new global.DC.Polyline(positions)
+                this.polyline.setStyle({
+                    width: 4,
                     material: global.DC.Namespace.Cesium.Color.fromBytes(
-                        129, 255, 0,
-                        200
-                    )
+                            200, 255, 255,
+                            200
+                    ),
+                    clampToGround: true
                 })
+                plotRegionLayer.addOverlay(this.polyline)
                 that.$parent.plotDetailsPopupShow(e.overlay.attrParams)
             })
 

--
Gitblit v1.9.3