修改坡度计算逻辑,骑行界面大部分完成

This commit is contained in:
lishuo committed 2021-03-31 20:46:57 +08:00
1 parent b0f6c39118
commit eb93577d68
131 files changed
+4314 -75444

No files matched your search

+2 -2
View File
@@ -70,12 +70,12 @@ namespace Assets.Scripts.Apis.Models
private void CalcDistance()
{
_List[0].Distance = 0;
for (int i = 1; i < _List.Count - 1; i++)
for (int i = 0; i < _List.Count - 1; i++)
{
var pt1 = Turf.Point(new double[] { _List[i].Point[1], _List[i].Point[0] });
var pt2 = Turf.Point(new double[] { _List[i+1].Point[1], _List[i+1].Point[0] });
var value = Turf.Distance(pt1, pt2, "kilometers") ;
_List[i].Distance = Math.Round(value, 6);
_List[i].Distance = Math.Round(value*1000, 2);
}
}
/// <summary>