refactor zo zod and felte

This commit is contained in:
Christian Beutel
2024-12-30 19:52:44 +01:00
parent 75c94a3ce4
commit 871481a84e
45 changed files with 659 additions and 1040 deletions

View File

@@ -3,7 +3,7 @@
import { fromFile, toGeoJson } from "$lib/util/gpx_util";
import { createEventDispatcher, onMount } from "svelte";
export let trailFile: File | null;
export let trailFile: File | undefined | null;
export let trailData: string | undefined;
export let label: string = "";
@@ -31,7 +31,7 @@
attributionControl: false,
dragPan: false,
scrollZoom: false,
preserveDrawingBuffer: true
preserveDrawingBuffer: true,
});
}
@@ -95,9 +95,12 @@
},
});
layer = map.getLayer(layerId) as M.LineLayerSpecification;
source = map.getSource(sourceId) as M.GeoJSONSource;
map.resize()
map.fitBounds(geojson.bbox as M.LngLatBoundsLike, {animate: false, padding: 8});
source = map.getSource(sourceId) as M.GeoJSONSource;
map.resize();
map.fitBounds(geojson.bbox as M.LngLatBoundsLike, {
animate: false,
padding: 8,
});
}
function removeTrailFromMap() {