mirror of
				https://github.com/ethan-zf/cesium-plot-js.git
				synced 2025-11-04 01:04:18 +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 {
 | 
					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) {
 | 
				
			||||||
 | 
				
			|||||||
@ -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();
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user