mirror of
https://github.com/ethan-zf/cesium-plot-js.git
synced 2025-06-23 19:17:29 +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) {
|
||||
this.setGeometryPoints(this.points);
|
||||
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) {
|
||||
this.setGeometryPoints(this.points);
|
||||
this.drawPolygon();
|
||||
} else if (this.points.length === 3) {
|
||||
this.lineEntity && this.viewer.entities.remove(this.lineEntity);
|
||||
} else {
|
||||
this.finishDrawing();
|
||||
}
|
||||
|
@ -459,6 +459,7 @@ export default class Base {
|
||||
this.polygonEntity.show = true;
|
||||
this.outlineEntity.polyline.clampToGround = true;
|
||||
this.outlineEntity.show = true;
|
||||
this.lineEntity && (this.lineEntity.show = true);
|
||||
} else if (this.type === 'line') {
|
||||
this.lineEntity.polyline.clampToGround = true;
|
||||
this.lineEntity.show = true;
|
||||
@ -470,6 +471,7 @@ export default class Base {
|
||||
this.polygonEntity.show = false;
|
||||
this.outlineEntity.polyline.clampToGround = false;
|
||||
this.outlineEntity.show = false;
|
||||
this.lineEntity && (this.lineEntity.show = false);
|
||||
} else if (this.type === 'line') {
|
||||
this.lineEntity.polyline.clampToGround = false;
|
||||
this.lineEntity.show = false;
|
||||
@ -480,6 +482,10 @@ export default class Base {
|
||||
if (this.type === 'polygon') {
|
||||
this.viewer.entities.remove(this.polygonEntity);
|
||||
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') {
|
||||
this.viewer.entities.remove(this.lineEntity);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user