mirror of
https://github.com/ethan-zf/cesium-plot-js.git
synced 2025-06-23 19:17:29 +00:00
StraightArrow edit
This commit is contained in:
parent
4f618ae5ba
commit
1d0a189151
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user