fix: panning interrupted while moving around the map (#19276)

This commit is contained in:
Daniel Dietzler 2025-06-19 13:28:53 +02:00 committed by GitHub
parent 0a9a520ed2
commit 07aa51638c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,7 @@
import { isEqual, omit } from 'lodash-es';
import { DateTime, Duration } from 'luxon';
import maplibregl, { GlobeControl, type GeoJSONSource, type LngLatLike } from 'maplibre-gl';
import { onDestroy, onMount } from 'svelte';
import { onDestroy, onMount, untrack } from 'svelte';
import { t } from 'svelte-i18n';
import {
AttributionControl,
@ -251,7 +251,11 @@
});
$effect(() => {
map?.jumpTo({ center, zoom });
if (!center || !zoom) {
return;
}
untrack(() => map?.jumpTo({ center, zoom }));
});
</script>