From d0ec0255ea2af46275ccf68e667fbb3f8248866a Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 25 Oct 2022 15:57:53 +0800
Subject: [PATCH] 绘制

---
 src/utils/EntityDraw.js |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/utils/EntityDraw.js b/src/utils/EntityDraw.js
index d41907c..c6c6a64 100644
--- a/src/utils/EntityDraw.js
+++ b/src/utils/EntityDraw.js
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2022-10-18 17:17:50
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2022-10-20 10:10:26
+ * @LastEditTime: 2022-10-25 15:41:19
  * @FilePath: \srs-police-affairs\src\utils\EntityDraw.js
  * @Description: 
  * 
@@ -20,6 +20,8 @@
     activeShape = null
 
     drawCompletePosition = []
+
+    type = ''
 
     constructor() {
         // 去除双击
@@ -44,7 +46,9 @@
         global.viewer.addLayer(this.drawPointLayer)
     }
 
-    activate () {
+    activate (type) {
+        this.type = type
+
         this.drawCompletePosition = []
 
         this.clearLayer()
@@ -201,4 +205,17 @@
     clearLayer () {
         this.drawPolygonLayer.clear()
     }
+
+    // 销毁
+    destroy () {
+        this.unRegisterEvents()
+        this.drawPolygonLayer.clear()
+        this.drawPolygonLayer.remove()
+        this.drawPointLayer.clear()
+        this.drawPointLayer.remove()
+
+        this.activeShape = null
+        this.activeShapePoints = []
+        this.drawCompletePosition = []
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3