shuishen
2022-10-25 d0ec0255ea2af46275ccf68e667fbb3f8248866a
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 = []
    }
}