adds profile page
This commit is contained in:
@@ -74,6 +74,7 @@ export default class GPX {
|
||||
|
||||
getTotals() {
|
||||
let totalElevationGain = 0;
|
||||
let totalElevationLoss = 0;
|
||||
let totalDuration = 0;
|
||||
let totalDistance = 0;
|
||||
|
||||
@@ -99,6 +100,8 @@ export default class GPX {
|
||||
const elevationDiff = elevation - previousElevation;
|
||||
if (elevationDiff > 0) {
|
||||
totalElevationGain += elevationDiff;
|
||||
} else {
|
||||
totalElevationLoss += Math.abs(elevationDiff)
|
||||
}
|
||||
|
||||
const distance = calculateDistance(
|
||||
@@ -112,7 +115,7 @@ export default class GPX {
|
||||
}
|
||||
}
|
||||
|
||||
return { distance: totalDistance, elevationGain: totalElevationGain, duration: totalDuration }
|
||||
return { distance: totalDistance, elevationGain: totalElevationGain, elevationLoss: totalElevationLoss, duration: totalDuration }
|
||||
}
|
||||
|
||||
static parse(gpxString: string): Promise<GPX | Error> {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { Trail } from "./trail";
|
||||
|
||||
class SummitLog {
|
||||
id?: string;
|
||||
@@ -5,10 +6,15 @@ class SummitLog {
|
||||
text?: string;
|
||||
gpx?: string;
|
||||
_gpx: File | null;
|
||||
distance?: number
|
||||
elevation_gain?: number
|
||||
elevation_loss?: number
|
||||
duration?: number
|
||||
author?: string;
|
||||
|
||||
expand: {
|
||||
gpx_data?: string;
|
||||
trails_via_summit_logs?: Trail[];
|
||||
}
|
||||
|
||||
constructor(date: string, params?: { id?: string, text?: string }) {
|
||||
|
||||
@@ -7,4 +7,5 @@ export type User = {
|
||||
password: string,
|
||||
avatar?: string;
|
||||
language?: string;
|
||||
created?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user