// 计算两点间角度,改变图标方向
calcAngle(start, end) {
let y = Math.sin(end.longitude - start.longitude) * Math.cos(end.latitude);
let x =
Math.cos(start.latitude) * Math.sin(end.latitude) -
Math.sin(start.latitude) * Math.cos(end.latitude) * Math.cos(end.longitude - start.longitude);
let angle= Math.atan2(y, x);
angle= (180 * angle) / Math.PI;
return angle;
}
uniapp地图计算两点角度,旋转图标(轨迹回放)
最新推荐文章于 2023-02-18 18:32:01 发布