adds elevation loss for trails

This commit is contained in:
Christian Beutel
2024-11-09 12:56:11 +01:00
parent 0ab0eda612
commit 01b0d49913
11 changed files with 108 additions and 19 deletions

View File

@@ -5,7 +5,7 @@ class SummitLog {
date: string;
text?: string;
gpx?: string;
_gpx: File | Blob | null;
_gpx: File | null;
distance?: number
elevation_gain?: number
elevation_loss?: number
@@ -17,11 +17,15 @@ class SummitLog {
trails_via_summit_logs?: Trail[];
}
constructor(date: string, params?: { id?: string, text?: string }) {
constructor(date: string, params?: { id?: string, text?: string, distance?: number, elevation_loss?: number, elevation_gain?: number, duration?: number }) {
this.date = date;
this.id = params?.id;
this.text = params?.text ?? "";
this.expand = {}
this.distance = params?.distance
this.elevation_gain = params?.elevation_gain
this.elevation_loss = params?.elevation_loss
this.duration = params?.duration
this._gpx = null
}
}

View File

@@ -12,6 +12,7 @@ class Trail {
public: boolean;
distance?: number;
elevation_gain?: number;
elevation_loss?: number;
duration?: number;
difficulty?: "easy" | "moderate" | "difficult"
lat?: number;
@@ -43,6 +44,7 @@ class Trail {
public?: boolean,
distance?: number,
elevation_gain?: number,
elevation_loss?: number,
duration?: number,
difficulty?: "easy" | "moderate" | "difficult",
lat?: number,
@@ -68,6 +70,7 @@ class Trail {
this.public = params?.public ?? false
this.distance = params?.distance;
this.elevation_gain = params?.elevation_gain;
this.elevation_loss = params?.elevation_loss;
this.duration = params?.duration;
this.difficulty = params?.difficulty ?? "easy";
this.lat = params?.lat;