Skip to content

High performance self-hosted photo and video management solution.

fix: disable map fly animation when switching between assets (#19223)

Zack Pollard864fe3d0d648
diff --git a/web/src/lib/components/shared-components/map/map.svelte b/web/src/lib/components/shared-components/map/map.svelte
index 0c8094a1a1..af9604b680 100644
--- a/web/src/lib/components/shared-components/map/map.svelte
+++ b/web/src/lib/components/shared-components/map/map.svelte
@@ -74,6 +74,8 @@
showSimpleControls = true,
}: Props = $props();
+ const initialCenter = center;
+
let map: maplibregl.Map | undefined = $state();
let marker: maplibregl.Marker | null = null;
let abortController: AbortController;
@@ -247,6 +249,10 @@
},
});
});
+
+ $effect(() => {
+ map?.jumpTo({ center, zoom });
+ });
</script>
<!-- We handle style loading ourselves so we set style blank here -->
@@ -254,8 +260,8 @@
{hash}
style=""
class="h-full {rounded ? 'rounded-2xl' : 'rounded-none'}"
- {center}
{zoom}
+ center={initialCenter}
attributionControl={false}
diffStyleUpdates={true}
onload={(event) => {