Add interpolated warning for stats with beeline
This commit is contained in:
parent
c122b31e73
commit
6a19b53dc0
3 changed files with 14 additions and 0 deletions
10
index.html
10
index.html
|
|
@ -1131,6 +1131,16 @@
|
|||
</div>
|
||||
<div id="stats-container" class="flexrow flexgrow">
|
||||
<ul id="stats">
|
||||
<li id="beeline-warning" hidden>
|
||||
<div class="text-muted small d-none d-md-block"> </div>
|
||||
<p class="stats-label">
|
||||
<abbr
|
||||
class="fa fa-exclamation-triangle"
|
||||
data-i18n="[title]footer.beeline-warning"
|
||||
title="Warning: no data for straight lines, values interpolated"
|
||||
></abbr>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<div class="text-muted small d-none d-md-block" data-i18n="footer.distance">Distance</div>
|
||||
<p class="stats-label">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ BR.TrackStats = L.Class.extend({
|
|||
$('#stats-container').show();
|
||||
$('#stats-info').hide();
|
||||
|
||||
const hasBeeline = segments.filter((line) => line?._routing?.beeline).length > 0;
|
||||
document.getElementById('beeline-warning').hidden = !hasBeeline;
|
||||
|
||||
var stats = this.calcStats(polyline, segments),
|
||||
length1 = L.Util.formatNum(stats.trackLength / 1000, 1).toLocaleString(),
|
||||
length3 = L.Util.formatNum(stats.trackLength / 1000, 3).toLocaleString(undefined, {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
},
|
||||
"footer": {
|
||||
"ascend": "Ascend",
|
||||
"beeline-warning": "Warning: no data for straight lines, values interpolated",
|
||||
"cost": "Cost",
|
||||
"distance": "Distance",
|
||||
"elevation-chart": "Toggle elevation chart",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue