adds profile page

This commit is contained in:
Christian Beutel
2024-11-03 15:13:25 +01:00
parent 0d8ff5c83b
commit bab22301af
31 changed files with 882 additions and 133 deletions

View File

@@ -36,7 +36,7 @@
autofitBounds: options.autofitBounds ?? true,
});
controlElevation.clear();
controlElevation.load(gpxData);
controlElevation.load(gpxData);
}
$: if (options) {

View File

@@ -3,7 +3,7 @@
import "leaflet/dist/leaflet.css";
import type { Map } from "leaflet";
import { onMount, tick } from "svelte";
import { createEventDispatcher, onMount, tick } from "svelte";
export let trailFile: File | null;
export let trailData: string | undefined;
export let label: string = "";
@@ -12,6 +12,8 @@
let L: any;
let layer: any;
const dispatch = createEventDispatcher();
$: if (trailData !== undefined) {
showTrailOnMap();
} else {
@@ -39,6 +41,8 @@
if (trailData) {
trailFile = null;
trailData = undefined;
dispatch("change", null)
} else {
document.getElementById("trail-input")!.click();
}
@@ -56,6 +60,8 @@
trailFile = files.item(0);
trailData = await trailFile?.text();
dispatch("change", trailData);
}
async function showTrailOnMap() {