From 1d0a18915159cf2f98bf465f0e62c0a6149e4ee4 Mon Sep 17 00:00:00 2001 From: ethan Date: Mon, 21 Aug 2023 14:53:16 +0800 Subject: [PATCH] StraightArrow edit --- src/arrow/straight-arrow.ts | 2 +- src/draw.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arrow/straight-arrow.ts b/src/arrow/straight-arrow.ts index 39454b1..b737f50 100644 --- a/src/arrow/straight-arrow.ts +++ b/src/arrow/straight-arrow.ts @@ -5,7 +5,7 @@ import { Cartesian3 } from '@examples/cesium'; export default class StraightArrow extends Draw { points: Cartesian3[] = []; arrowLengthScale: number = 5; - maxArrowLength: number = 2; + maxArrowLength: number = 3000000; type: 'polygon' | 'line'; constructor(cesium: any, viewer: any, style: any) { diff --git a/src/draw.ts b/src/draw.ts index 149fd40..0b52032 100644 --- a/src/draw.ts +++ b/src/draw.ts @@ -69,9 +69,9 @@ export default class Draw { } 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. if (hitEntities && activeEntity.id === pickedObject.id.id) { - const pickedEntity = pickedObject.id; - if (this.cesium.defined(pickedEntity.polygon)) { - // Hit PolygonGraphics geometry. + const pickedGraphics = this.type === 'line' ? pickedObject.id.polyline : pickedObject.id.polygon; + if (this.cesium.defined(pickedGraphics)) { + // Hit Geometry Shape. this.setState('edit'); this.addControlPoints(); }