Fix bug where distance was calculated wrongly
This commit is contained in:
@@ -78,8 +78,6 @@ export class DashboardComponent implements AfterViewInit {
|
|||||||
const dist1 = beats[i].coordinate;
|
const dist1 = beats[i].coordinate;
|
||||||
const dist2 = beats[i + 1].coordinate;
|
const dist2 = beats[i + 1].coordinate;
|
||||||
tDistance += this.api.distanceInKmBetweenEarthCoordinates(dist1[0], dist1[1], dist2[0], dist2[1]);
|
tDistance += this.api.distanceInKmBetweenEarthCoordinates(dist1[0], dist1[1], dist2[0], dist2[1]);
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.totalDistance = tDistance.toFixed(2);
|
this.totalDistance = tDistance.toFixed(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user