diff --git a/src/arrow/double-arrow.ts b/src/arrow/double-arrow.ts index 4f9e76a..3dcf1a8 100644 --- a/src/arrow/double-arrow.ts +++ b/src/arrow/double-arrow.ts @@ -56,8 +56,8 @@ export default class DoubleArrow extends Base { this.curveControlPointLeft = this.cesium.Cartesian3.fromDegrees(this.llBodyPnts[2][0], this.llBodyPnts[2][1]); this.curveControlPointRight = this.cesium.Cartesian3.fromDegrees(this.rrBodyPnts[1][0], this.rrBodyPnts[1][1]); - // 辅助查看插值控制点位置 - // this.CesiumViewer.entities.add({ + // // 辅助查看插值控制点位置 + // this.viewer.entities.add({ // position: this.curveControlPointLeft, // point: { // pixelSize: 10, @@ -65,7 +65,7 @@ export default class DoubleArrow extends Base { // color: this.cesium.Color.RED, // }, // }); - // this.CesiumViewer.entities.add({ + // this.viewer.entities.add({ // position: this.curveControlPointRight, // point: { // pixelSize: 10, @@ -75,6 +75,12 @@ export default class DoubleArrow extends Base { // }); } } + + // finishDrawing() { + // this.curveControlPointLeft = this.cesium.Cartesian3.fromDegrees(this.llBodyPnts[2][0], this.llBodyPnts[2][1]); + // this.curveControlPointRight = this.cesium.Cartesian3.fromDegrees(this.rrBodyPnts[1][0], this.rrBodyPnts[1][1]); + // super.finishDrawing(); + // } /** * Draw a shape based on mouse movement points during the initial drawing. */ diff --git a/src/base.ts b/src/base.ts index 6c38502..0437858 100644 --- a/src/base.ts +++ b/src/base.ts @@ -278,7 +278,7 @@ export default class Base { this.tempLineEntity = this.addLineEntity(lineStyle); } } - + removeTempLine() { if (this.tempLineEntity) { this.viewer.entities.remove(this.tempLineEntity); @@ -725,10 +725,7 @@ export default class Base { private doubleArrowGrowthAnimation(duration: number = 2000, delay: number = 0, callback?: Function) { setTimeout(() => { - this.viewer.entities.remove(this.polygonEntity); - this.viewer.entities.remove(this.outlineEntity); - this.polygonEntity = null; - this.outlineEntity = null; + this.hideWithAnimation(0, 0, undefined); const points = this.getPoints(); let startTime = Date.now(); this.viewer.clock.shouldAnimate = true; @@ -783,7 +780,7 @@ export default class Base { tempPoints[3] = newPositionLeft; const geometryPoints = this.createGraphic(tempPoints); this.setGeometryPoints(geometryPoints); - this.drawPolygon(); + this.showWithAnimation(0, 0, undefined); }; this.viewer.clock.onTick.addEventListener(frameListener); }, delay);