starts transition to maplibre

This commit is contained in:
Christian Beutel
2024-11-26 00:19:41 +01:00
parent b9ae01846b
commit b6b409e855
21 changed files with 2143 additions and 34 deletions

View File

@@ -7,7 +7,7 @@
style="height: calc(100dvh - 120px); font-size: 4rem"
>
<img
class="absolute top-1/2 left-1/2 aspect-square rounded-xl object-cover"
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 aspect-square rounded-xl object-cover"
width="500"
src="/imgs/error.webp"
alt="Default error img"

View File

@@ -1,15 +1,15 @@
<script lang="ts">
import MapWithElevation from "$lib/components/trail/map_with_elevation.svelte";
import MapWithElevationMaplibre from "$lib/components/trail/map_with_elevation_maplibre.svelte";
import TrailInfoPanel from "$lib/components/trail/trail_info_panel.svelte";
import { trail } from "$lib/stores/trail_store";
import "$lib/vendor/leaflet-elevation/src/index.css";
import type { Marker } from "leaflet";
import "leaflet.awesome-markers/dist/leaflet.awesome-markers.css";
import "leaflet/dist/leaflet.css";
import * as M from "maplibre-gl";
import "photoswipe/style.css";
import { _ } from "svelte-i18n";
let markers: Marker[];
let markers: M.Marker[];
</script>
<svelte:head>
@@ -18,7 +18,7 @@
<main class="grid grid-cols-1 md:grid-cols-[458px_1fr] gap-x-1 gap-y-4">
<TrailInfoPanel trail={$trail} {markers}></TrailInfoPanel>
<div id="trail-details" class="sticky top-[62px]">
<MapWithElevation trail={$trail} bind:markers></MapWithElevation>
<MapWithElevationMaplibre trail={$trail} bind:markers></MapWithElevationMaplibre>
</div>
</main>

View File

@@ -0,0 +1,8 @@
<script>
import MapWithElevationMaplibre from "$lib/components/trail/map_with_elevation_maplibre.svelte";
import { onMount } from "svelte";
export let data;
</script>
<MapWithElevationMaplibre trail={data.trail}></MapWithElevationMaplibre>

View File

@@ -0,0 +1,9 @@
import type { Trail } from "$lib/models/trail";
import { trails_show } from "$lib/stores/trail_store";
export const load = async ({ params, fetch }) => {
const t: Trail = await trails_show("yesm2tqc6jok8jq", true, fetch)
return { trail: t }
};

View File

@@ -296,7 +296,6 @@
elevation_loss: $form.elevation_loss,
duration: $form.duration ? $form.duration * 60 : undefined,
});
console.log(selectedFile.type);
log.expand.gpx_data = gpxData;
const blob = new Blob([gpxData], { type: selectedFile.type });