From c08826089de55d31d501db220f9c9d2fdbdd84b8 Mon Sep 17 00:00:00 2001 From: ethan Date: Mon, 20 May 2024 19:05:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8F=8C=E7=AE=AD?= =?UTF-8?q?=E5=A4=B4=E6=89=A7=E8=A1=8C=E7=94=9F=E9=95=BF=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=8B=96=E6=8B=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arrow/double-arrow.ts | 12 +++++++++--- src/base.ts | 9 +++------ 2 files changed, 12 insertions(+), 9 deletions(-) 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);