Merge pull request #13 from qjh999/main

校准曲线箭头的箭头角度
This commit is contained in:
ethan 2024-05-27 18:16:08 +08:00 committed by GitHub
commit 13cf991d8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,8 +86,8 @@ export default class CurvedArrow extends Base {
const distance = Utils.wholeDistance(lnglatPoints);
let len = distance / this.arrowLengthScale;
len = len > this.maxArrowLength ? this.maxArrowLength : len;
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, true);
const leftPnt = Utils.getThirdPoint(curvePoints[curvePoints.length - 2], curvePoints[curvePoints.length - 1], Math.PI / 6, len / 2, false);
const rightPnt = Utils.getThirdPoint(curvePoints[curvePoints.length - 2], curvePoints[curvePoints.length - 1], Math.PI / 6, len / 2, true);
const temp = [].concat(...curvePoints);
const points = [...temp, ...leftPnt, ...pnt2, ...rightPnt];
const cartesianPoints = this.cesium.Cartesian3.fromDegreesArray(points);