mirror of
				https://github.com/ethan-zf/cesium-plot-js.git
				synced 2025-11-04 01:04:18 +00:00 
			
		
		
		
	Fix the issue where polygons and triangles cannot delete their outer edges when removed.
This commit is contained in:
		
							parent
							
								
									22826df7e1
								
							
						
					
					
						commit
						0530a03428
					
				@ -38,8 +38,6 @@ export default class AttackArrow extends Base {
 | 
				
			|||||||
    } else if (this.points.length === 2) {
 | 
					    } else if (this.points.length === 2) {
 | 
				
			||||||
      this.setGeometryPoints(this.points);
 | 
					      this.setGeometryPoints(this.points);
 | 
				
			||||||
      this.drawPolygon();
 | 
					      this.drawPolygon();
 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      this.lineEntity && this.viewer.entities.remove(this.lineEntity);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -42,8 +42,6 @@ export default class DoubleArrow extends Base {
 | 
				
			|||||||
    } else if (this.points.length === 2) {
 | 
					    } else if (this.points.length === 2) {
 | 
				
			||||||
      this.setGeometryPoints(this.points);
 | 
					      this.setGeometryPoints(this.points);
 | 
				
			||||||
      this.drawPolygon();
 | 
					      this.drawPolygon();
 | 
				
			||||||
    } else if (this.points.length === 3) {
 | 
					 | 
				
			||||||
      this.lineEntity && this.viewer.entities.remove(this.lineEntity);
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      this.finishDrawing();
 | 
					      this.finishDrawing();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -459,6 +459,7 @@ export default class Base {
 | 
				
			|||||||
      this.polygonEntity.show = true;
 | 
					      this.polygonEntity.show = true;
 | 
				
			||||||
      this.outlineEntity.polyline.clampToGround = true;
 | 
					      this.outlineEntity.polyline.clampToGround = true;
 | 
				
			||||||
      this.outlineEntity.show = true;
 | 
					      this.outlineEntity.show = true;
 | 
				
			||||||
 | 
					      this.lineEntity && (this.lineEntity.show = true);
 | 
				
			||||||
    } else if (this.type === 'line') {
 | 
					    } else if (this.type === 'line') {
 | 
				
			||||||
      this.lineEntity.polyline.clampToGround = true;
 | 
					      this.lineEntity.polyline.clampToGround = true;
 | 
				
			||||||
      this.lineEntity.show = true;
 | 
					      this.lineEntity.show = true;
 | 
				
			||||||
@ -470,6 +471,7 @@ export default class Base {
 | 
				
			|||||||
      this.polygonEntity.show = false;
 | 
					      this.polygonEntity.show = false;
 | 
				
			||||||
      this.outlineEntity.polyline.clampToGround = false;
 | 
					      this.outlineEntity.polyline.clampToGround = false;
 | 
				
			||||||
      this.outlineEntity.show = false;
 | 
					      this.outlineEntity.show = false;
 | 
				
			||||||
 | 
					      this.lineEntity && (this.lineEntity.show = false);
 | 
				
			||||||
    } else if (this.type === 'line') {
 | 
					    } else if (this.type === 'line') {
 | 
				
			||||||
      this.lineEntity.polyline.clampToGround = false;
 | 
					      this.lineEntity.polyline.clampToGround = false;
 | 
				
			||||||
      this.lineEntity.show = false;
 | 
					      this.lineEntity.show = false;
 | 
				
			||||||
@ -480,6 +482,10 @@ export default class Base {
 | 
				
			|||||||
    if (this.type === 'polygon') {
 | 
					    if (this.type === 'polygon') {
 | 
				
			||||||
      this.viewer.entities.remove(this.polygonEntity);
 | 
					      this.viewer.entities.remove(this.polygonEntity);
 | 
				
			||||||
      this.viewer.entities.remove(this.outlineEntity);
 | 
					      this.viewer.entities.remove(this.outlineEntity);
 | 
				
			||||||
 | 
					      this.lineEntity && this.viewer.entities.remove(this.lineEntity);
 | 
				
			||||||
 | 
					      this.polygonEntity = null;
 | 
				
			||||||
 | 
					      this.outlineEntity = null;
 | 
				
			||||||
 | 
					      this.lineEntity = null;
 | 
				
			||||||
    } else if (this.type === 'line') {
 | 
					    } else if (this.type === 'line') {
 | 
				
			||||||
      this.viewer.entities.remove(this.lineEntity);
 | 
					      this.viewer.entities.remove(this.lineEntity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user