add average speed in Trip summary (#171)

This commit is contained in:
Didier C 2021-08-31 21:07:25 +02:00 committed by GitHub
parent 85dbfe8604
commit e69cb34cc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,6 +367,10 @@ export default class TrackViewModel extends ViewModel {
<div class="menu-title">${$._('summary')}</div>
<div><img class="icon" alt="${$._('tdistance')}" title="${$._('tdistance')}" src="images/distance.svg"> ${$.getLocaleDistanceMajor(last.totalMeters, true)}</div>
<div><img class="icon" alt="${$._('ttime')}" title="${$._('ttime')}" src="images/time.svg"> ${$.getLocaleDuration(last.totalSeconds)}</div>`;
if (last.totalSeconds > 0) {
summary += `
<div><img class="icon" alt="${$._('aspeed')}" title="${$._('aspeed')}" src="images/speed.svg"><b>&#10547;</b> ${$.getLocaleSpeed(last.totalMeters / last.totalSeconds, true)}</div>`;
}
if (track.hasSpeeds) {
summary += `<div><img class="icon" alt="${$._('speed')}" title="${$._('speed')}" src="images/speed.svg"><b>&#10138;</b> ${$.getLocaleSpeed(track.maxSpeed, true)}</div>`;
}