mirror of
https://github.com/ethan-zf/cesium-plot-js.git
synced 2025-06-24 03:27:29 +00:00
feat: 绘制过程中,撤销上一个point
This commit is contained in:
parent
7d75b6414e
commit
311792e54b
@ -35,6 +35,25 @@ export default class Polygon extends Base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* backout the last point
|
||||||
|
*/
|
||||||
|
removePoint() {
|
||||||
|
if (this.points.length > 0) {
|
||||||
|
this.points.pop();
|
||||||
|
this.setGeometryPoints(this.points);
|
||||||
|
if (this.points.length === 2) {
|
||||||
|
this.addTempLine();
|
||||||
|
} else {
|
||||||
|
this.removeTempLine();
|
||||||
|
this.drawPolygon();
|
||||||
|
}
|
||||||
|
if(this.points.length === 0) {
|
||||||
|
this.removeMoveListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare whether the positions of two points are equal.
|
* Compare whether the positions of two points are equal.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user