From 3e8cca7cc78a6c21dbb65db5c5c5d9586b90b657 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 18 Nov 2022 09:27:44 +0800
Subject: [PATCH] 1
---
src/utils/EntityDraw.js | 36 ++++++++++++++++++++++++------------
1 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/utils/EntityDraw.js b/src/utils/EntityDraw.js
index ec9ad67..2c0429d 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-11-17 16:29:06
+ * @LastEditTime: 2022-11-18 09:22:49
* @FilePath: \srs-police-affairs\src\utils\EntityDraw.js
* @Description:
*
@@ -61,6 +61,8 @@
this.getMoveEvent = this.getMoveEvent.bind(this)
this.getRightEvent = this.getRightEvent.bind(this)
+ this.resizePolyLineGon = this.resizePolyLineGon.bind(this)
+
this.Cesium = global.DC.Namespace.Cesium
this.eventHandler = new global.DC.Namespace.Cesium.ScreenSpaceEventHandler(global.viewer.scene.canvas)
@@ -102,10 +104,9 @@
this.registerEvents()
- this.initLeftDownEventHandler()
- this.initLeftUpEventHandler()
-
- this.initMouseMoveEventHandler()
+ // this.initLeftDownEventHandler()
+ // this.initLeftUpEventHandler()
+ // this.initMouseMoveEventHandler()
}
deactivate () {
@@ -236,8 +237,7 @@
return
}
}
- this.lastEventData = event.windowPosition
- this.cb(this.lastEventData)
+
this.terminateShape()
}
@@ -268,13 +268,13 @@
this.drawPolylineLayer.addOverlay(polyline)
- this.addPolyLineGon(100)
+ this.addPolyLineGon(100, this.cb)
- this.EditMoveCenterPositoin = this.Cesium.Cartesian3.fromDegrees(this.drawCompletePosition[this.drawCompletePosition.length - 1].lng + 200 * lngOneM, this.drawCompletePosition[this.drawCompletePosition.length - 1].lat + 200 * latOneM, 0)
+ // this.EditMoveCenterPositoin = this.Cesium.Cartesian3.fromDegrees(this.drawCompletePosition[this.drawCompletePosition.length - 1].lng + 200 * lngOneM, this.drawCompletePosition[this.drawCompletePosition.length - 1].lat + 200 * latOneM, 0)
- global.viewer.scene.globe.depthTestAgainstTerrain = true
+ // global.viewer.scene.globe.depthTestAgainstTerrain = true
- this.createEditMoveCenterEntity()
+ // this.createEditMoveCenterEntity()
} else {
let polygon = new global.DC.Polygon(this.drawCompletePosition)
@@ -285,6 +285,10 @@
})
this.drawPolygonLayer.addOverlay(polygon)
+
+ this.lastEventData = this.drawCompletePosition
+
+ this.cb(this.lastEventData)
}
this.clickInTheProcess()
@@ -339,7 +343,11 @@
this.drawCompletePosition = []
}
- addPolyLineGon (num) {
+ resizePolyLineGon (num) {
+ this.addPolyLineGon(num)
+ }
+
+ addPolyLineGon (num, cb) {
this.drawPolyLineGonLayer.clear()
let coords = global.DC.GeoTools.polylineBuffer(this.drawCompletePosition, num)
@@ -351,6 +359,10 @@
})
this.drawPolyLineGonLayer.addOverlay(polygon)
+
+ this.lastEventData = coords
+
+ cb(this.lastEventData)
}
//场景鼠标左键按下事件
--
Gitblit v1.9.3