From e69cb34cc0c8826a0a9b296349157e20d816985d Mon Sep 17 00:00:00 2001 From: Didier C Date: Tue, 31 Aug 2021 21:07:25 +0200 Subject: [PATCH] add average speed in Trip summary (#171) --- js/src/trackviewmodel.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/trackviewmodel.js b/js/src/trackviewmodel.js index 57fa35d..7a07333 100644 --- a/js/src/trackviewmodel.js +++ b/js/src/trackviewmodel.js @@ -367,6 +367,10 @@ export default class TrackViewModel extends ViewModel {
${$._('tdistance')} ${$.getLocaleDistanceMajor(last.totalMeters, true)}
${$._('ttime')} ${$.getLocaleDuration(last.totalSeconds)}
`; + if (last.totalSeconds > 0) { + summary += ` +
${$._('aspeed')} ${$.getLocaleSpeed(last.totalMeters / last.totalSeconds, true)}
`; + } if (track.hasSpeeds) { summary += `
${$._('speed')} ${$.getLocaleSpeed(track.maxSpeed, true)}
`; }