mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-19 09:22:12 +00:00
sparser data transfers
This commit is contained in:
1 parent
4583874e7e
commit
a07da16163
15 files changed
+22
-24
No files matched your search
@@ -226,23 +226,25 @@ export class ElevationProfile {
|
||||
const details =
|
||||
hovered?.index === point.index ? hovered.point : undefined;
|
||||
const elevationFill = get(this._elevationFill);
|
||||
let slope = `${this._data.slope[point.index]?.toFixed(1)} %`;
|
||||
if (
|
||||
elevationFill === 'slope' &&
|
||||
details?.slopeSegmentSlope !== undefined &&
|
||||
details.slopeSegmentDistance !== undefined
|
||||
) {
|
||||
slope += ` (${getDistanceWithUnits(details.slopeSegmentDistance)} @${details.slopeSegmentSlope.toFixed(1)} %)`;
|
||||
}
|
||||
|
||||
let labels = [
|
||||
` ${i18n._('quantities.distance')}: ${getDistanceWithUnits(point.x, false)}`,
|
||||
` ${i18n._('quantities.slope')}: ${slope}`,
|
||||
];
|
||||
|
||||
if (!details) {
|
||||
return labels;
|
||||
}
|
||||
if (details.slope !== undefined) {
|
||||
let slope = `${details.slope.toFixed(1)} %`;
|
||||
if (
|
||||
elevationFill === 'slope' &&
|
||||
details.slopeSegmentSlope !== undefined &&
|
||||
details.slopeSegmentDistance !== undefined
|
||||
) {
|
||||
slope += ` (${getDistanceWithUnits(details.slopeSegmentDistance)} @${details.slopeSegmentSlope.toFixed(1)} %)`;
|
||||
}
|
||||
labels.push(` ${i18n._('quantities.slope')}: ${slope}`);
|
||||
}
|
||||
let surface = details.surface ?? 'unknown';
|
||||
let highway = details.highway ?? 'unknown';
|
||||
let sacScale = details.sacScale;
|
||||
|
||||
Reference in new issue
Block a user