StraightArrow edit

This commit is contained in:
ethan 2023-08-21 14:53:16 +08:00
parent 4f618ae5ba
commit 1d0a189151
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import { Cartesian3 } from '@examples/cesium';
export default class StraightArrow extends Draw { export default class StraightArrow extends Draw {
points: Cartesian3[] = []; points: Cartesian3[] = [];
arrowLengthScale: number = 5; arrowLengthScale: number = 5;
maxArrowLength: number = 2; maxArrowLength: number = 3000000;
type: 'polygon' | 'line'; type: 'polygon' | 'line';
constructor(cesium: any, viewer: any, style: any) { constructor(cesium: any, viewer: any, style: any) {

View File

@ -69,9 +69,9 @@ export default class Draw {
} else if (this.state === 'static') { } else if (this.state === 'static') {
//When drawing multiple shapes, the click events for all shapes are triggered. Only when hitting a completed shape should it enter editing mode. //When drawing multiple shapes, the click events for all shapes are triggered. Only when hitting a completed shape should it enter editing mode.
if (hitEntities && activeEntity.id === pickedObject.id.id) { if (hitEntities && activeEntity.id === pickedObject.id.id) {
const pickedEntity = pickedObject.id; const pickedGraphics = this.type === 'line' ? pickedObject.id.polyline : pickedObject.id.polygon;
if (this.cesium.defined(pickedEntity.polygon)) { if (this.cesium.defined(pickedGraphics)) {
// Hit PolygonGraphics geometry. // Hit Geometry Shape.
this.setState('edit'); this.setState('edit');
this.addControlPoints(); this.addControlPoints();
} }