windkarte: scroll map into view when URL hash selects an area
Deploy / verify (push) Successful in 54s
Deploy / deploy (push) Successful in 1m4s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-05-18 09:45:46 +02:00
parent cd362fb811
commit f08e3bb790
@@ -27,6 +27,7 @@ let areas = $state<WindArea[]>([]);
let hiddenStatuses = $state<string[]>(["rechtskraeftig"]);
let hiddenRings = $state<string[]>([]);
let mapActive = $state(false);
let blockEl: HTMLDivElement;
function toggleStatus(status: string) {
hiddenStatuses = hiddenStatuses.includes(status)
@@ -87,10 +88,14 @@ let areas = $state<WindArea[]>([]);
// Map renders without CMS metadata — GeoJSON tooltips still work
}
mapReady = true;
if (initialGebietsNr) {
setTimeout(() => blockEl?.scrollIntoView({ behavior: "smooth", block: "start" }), 100);
}
});
</script>
<div
bind:this={blockEl}
class="wind-map-block {layoutClasses}"
data-block="WindMap"
data-block-type="wind_map"