feat: fetch metadata from pmtiles
Some checks failed
TrafficCue CI / check (push) Failing after 1m45s
TrafficCue CI / build (push) Successful in 10m34s
TrafficCue CI / build-android (push) Has been cancelled

This commit is contained in:
2025-10-21 15:33:31 +02:00
parent 4ef2667c4e
commit 621691277e
5 changed files with 114 additions and 13 deletions

View File

@ -1,6 +1,7 @@
import { LNV_SERVER } from "$lib/services/hosts";
import { routing } from "$lib/services/navigation/routing.svelte";
import { getTransportationMeta } from "$lib/services/TileMeta";
import type { WrappedValue } from "$lib/services/stores.svelte";
import { getMeta } from "$lib/services/TileMeta";
import { map } from "./map.svelte";
export const location = $state({
@ -40,7 +41,7 @@ export function isDriving() {
return _isDriving;
}
const roadMetadata = $derived(getTransportationMeta({ lat: location.lat, lon: location.lng }));
const roadMetadata: WrappedValue<GeoJSON.GeoJsonProperties> = $state({ current: null });
export function getRoadMetadata() {
return roadMetadata;
@ -59,6 +60,10 @@ export function watchLocation() {
location.available = true;
location.heading = pos.coords.heading;
location.lastUpdate = new Date();
getMeta({ lat: location.lat, lon: location.lng }, "transportation").then((meta) => {
roadMetadata.current = meta;
});
if (location.locked) {
map.value?.flyTo(