This commit is contained in:
Daniel Dietzler 2025-05-20 19:52:23 +02:00 committed by GitHub
parent 53420b7c02
commit 12b7a079c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 35 deletions

View file

@ -57,7 +57,7 @@
}
let {
mapMarkers = $bindable([]),
mapMarkers = $bindable(),
showSettings = true,
zoom = undefined,
center = $bindable(undefined),
@ -210,11 +210,13 @@
};
onMount(async () => {
mapMarkers = await loadMapMarkers();
if (!mapMarkers) {
mapMarkers = await loadMapMarkers();
}
});
onDestroy(() => {
abortController.abort();
abortController?.abort();
});
$effect(() => {
@ -296,7 +298,7 @@
<GeoJSON
data={{
type: 'FeatureCollection',
features: mapMarkers.map((marker) => asFeature(marker)),
features: mapMarkers?.map((marker) => asFeature(marker)) ?? [],
}}
id="geojson"
cluster={{ radius: 35, maxZoom: 17 }}