refactor map popups and add inspect trackpoint feature

This commit is contained in:
vcoppe
2024-10-08 15:49:14 +02:00
parent d823f44558
commit 711825f5a3
14 changed files with 396 additions and 289 deletions

View File

@@ -12,6 +12,7 @@ import mapboxgl from "mapbox-gl";
import tilebelt from "@mapbox/tilebelt";
import { PUBLIC_MAPBOX_TOKEN } from "$env/static/public";
import PNGReader from "png.js";
import type { DateFormatter } from "@internationalized/date";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
@@ -215,4 +216,16 @@ export function getURLForLanguage(lang: string | null | undefined, path: string)
return `${base}${newPath}`;
}
}
}
}
function getDateFormatter(locale: string) {
return new Intl.DateTimeFormat(locale, {
dateStyle: 'medium',
timeStyle: 'medium'
});
}
export let df: DateFormatter = getDateFormatter('en');
locale.subscribe((l) => {
df = getDateFormatter(l ?? 'en');
});