| | |
| | | * @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: |
| | | * |
| | |
| | | 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) |
| | |
| | | // 添加编辑点图层 |
| | | this.emitPointLayer = new global.DC.VectorLayer('emitPointLayer') |
| | | global.viewer.addLayer(this.emitPointLayer) |
| | | |
| | | |
| | | // global.viewer.scene.globe.depthTestAgainstTerrain = true |
| | | } |
| | | |
| | | // draw执行这个 |
| | |
| | | this.registerEvents() |
| | | |
| | | |
| | | this.initLeftDownEventHandler() |
| | | this.initLeftUpEventHandler() |
| | | |
| | | this.initMouseMoveEventHandler() |
| | | // this.initLeftDownEventHandler() |
| | | // this.initLeftUpEventHandler() |
| | | // this.initMouseMoveEventHandler() |
| | | } |
| | | |
| | | deactivate () { |
| | |
| | | return |
| | | } |
| | | } |
| | | this.lastEventData = event.windowPosition |
| | | this.cb(this.lastEventData) |
| | | this.terminateShape() |
| | | } |
| | | |
| | | getLastEventData () { |
| | | return this.lastEventData |
| | | this.terminateShape() |
| | | } |
| | | |
| | | terminateShape () { |
| | |
| | | |
| | | 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 |
| | | |
| | | this.createEditMoveCenterEntity() |
| | | |
| | | // this.createEditMoveCenterEntity() |
| | | } else { |
| | | let polygon = new global.DC.Polygon(this.drawCompletePosition) |
| | | |
| | |
| | | ) |
| | | }) |
| | | |
| | | |
| | | // console.log(polygon, 999) |
| | | |
| | | this.drawPolygonLayer.addOverlay(polygon) |
| | | |
| | | this.lastEventData = { |
| | | type: 'polygon', |
| | | data: this.drawCompletePosition |
| | | } |
| | | |
| | | this.cb(this.lastEventData) |
| | | } |
| | | |
| | | this.clickInTheProcess() |
| | |
| | | this.drawCompletePosition = [] |
| | | } |
| | | |
| | | addPolyLineGon (num) { |
| | | resizePolyLineGon (num) { |
| | | this.addPolyLineGon(num) |
| | | } |
| | | |
| | | addPolyLineGon (num, cb) { |
| | | this.drawPolyLineGonLayer.clear() |
| | | |
| | | let coords = global.DC.GeoTools.polylineBuffer(this.drawCompletePosition, num) |
| | |
| | | }) |
| | | |
| | | this.drawPolyLineGonLayer.addOverlay(polygon) |
| | | |
| | | this.lastEventData = { |
| | | type: 'line', |
| | | data: coords, |
| | | lineData: this.drawCompletePosition |
| | | } |
| | | |
| | | cb(this.lastEventData) |
| | | } |
| | | |
| | | //场景鼠标左键按下事件 |