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
@@ -527,6 +527,9 @@ impl TrackpointDetails {
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SelectionPoint {
|
||||
/// Slope (%) at the trackpoint.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub slope: Option<f64>,
|
||||
/// ms since the epoch.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub time: Option<f64>,
|
||||
|
||||
@@ -153,7 +153,6 @@ buffers!(
|
||||
total_distance,
|
||||
elevation_gain,
|
||||
elevation_loss,
|
||||
slope,
|
||||
lng,
|
||||
lat,
|
||||
ele
|
||||
@@ -202,6 +201,7 @@ pub fn selection_point<H: History>(engine: &Engine<H>, index: usize) -> Option<S
|
||||
let segment = stats.slope_segments.at(index);
|
||||
let finite = |value: f64| value.is_finite().then_some(value);
|
||||
Some(SelectionPoint {
|
||||
slope: finite(stats.slope[index]),
|
||||
time: stats
|
||||
.time
|
||||
.as_ref()
|
||||
|
||||
Reference in new issue
Block a user