mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-02 10:02:12 +00:00
fix local elevation gain computation
This commit is contained in:
@@ -1030,10 +1030,10 @@ export class TrackSegment extends GPXTreeLeaf {
|
|||||||
statistics.local.distance.total[j] - statistics.local.distance.total[start];
|
statistics.local.distance.total[j] - statistics.local.distance.total[start];
|
||||||
const localEle = dist > 0 ? (localDist / dist) * ele : 0;
|
const localEle = dist > 0 ? (localDist / dist) * ele : 0;
|
||||||
statistics.local.elevation.gain.push(
|
statistics.local.elevation.gain.push(
|
||||||
statistics.global.elevation.gain + localEle > 0 ? localEle : 0
|
statistics.global.elevation.gain + (localEle > 0 ? localEle : 0)
|
||||||
);
|
);
|
||||||
statistics.local.elevation.loss.push(
|
statistics.local.elevation.loss.push(
|
||||||
statistics.global.elevation.loss + localEle < 0 ? localEle : 0
|
statistics.global.elevation.loss + (localEle < 0 ? -localEle : 0)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user