From cd362fb8118bc12c9d5d8d0a1858fc67750a01ae Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Mon, 18 May 2026 09:26:19 +0200 Subject: [PATCH] =?UTF-8?q?windkarte:=20Rechtskr=C3=A4ftig=20default=20hid?= =?UTF-8?q?den,=20remove=20Entwurf-2-voraussichtlich,=202km/5km=20rings=20?= =?UTF-8?q?on=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hide status badge for rechtskraeftig in WindAreaPanel - Default hiddenStatuses=["rechtskraeftig"] so polygons start hidden - Fix: call restyleAll after geojsonLayer init so initial hidden state applies - Default hiddenRings=[] so 2km+5km buffer rings show on selection - Remove entwurf_2_voraussichtlich from legend - Lower maxZoom 12→11 for more context on feature select Co-Authored-By: Claude Sonnet 4.6 --- src/lib/components/WindAreaPanel.svelte | 2 +- src/lib/components/WindkarteMap.svelte | 8 +++++--- src/lib/components/blocks/WindkarteBlock.svelte | 9 ++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib/components/WindAreaPanel.svelte b/src/lib/components/WindAreaPanel.svelte index e5f7117..bdf82dc 100644 --- a/src/lib/components/WindAreaPanel.svelte +++ b/src/lib/components/WindAreaPanel.svelte @@ -54,7 +54,7 @@
{area.gebiets_nr} - {#if area.status} + {#if area.status && area.status !== 'rechtskraeftig'} {t(STATUS_KEY[area.status] ?? area.status)} diff --git a/src/lib/components/WindkarteMap.svelte b/src/lib/components/WindkarteMap.svelte index ae01382..64cbb06 100644 --- a/src/lib/components/WindkarteMap.svelte +++ b/src/lib/components/WindkarteMap.svelte @@ -9,7 +9,7 @@ onready = null, initialGebietsNr = null, hiddenStatuses = [], - hiddenRings = ["2km", "5km"], + hiddenRings = [], }: { areas: WindArea[]; onselect: (area: WindArea | null, center: [number, number] | null) => void; @@ -52,7 +52,7 @@ let selectedSlug = $state(null); let geojsonLayer: import("leaflet").GeoJSON | null = null; let buffering = $state(false); - let _hiddenRings: string[] = ["2km", "5km"]; + let _hiddenRings: string[] = []; $effect(() => { _hiddenRings = hiddenRings; @@ -164,7 +164,7 @@ map!.fitBounds((layer as import("leaflet").Polygon).getBounds(), { paddingTopLeft: [40, 40], paddingBottomRight: [desktop ? 320 : 40, desktop ? 40 : 300], - maxZoom: 12, + maxZoom: 11, }); } } @@ -278,6 +278,8 @@ }, }).addTo(map); + restyleAll(selectedSlug); + // Labels: show from zoom 13, scale font proportionally with zoom const syncLabels = () => { if (!labelLayer || !map) return; diff --git a/src/lib/components/blocks/WindkarteBlock.svelte b/src/lib/components/blocks/WindkarteBlock.svelte index ba41edf..99b72bf 100644 --- a/src/lib/components/blocks/WindkarteBlock.svelte +++ b/src/lib/components/blocks/WindkarteBlock.svelte @@ -24,8 +24,8 @@ let areas = $state([]); let mapReady = $state(false); let initialGebietsNr = $state(null); let resetMap: (() => void) | null = null; - let hiddenStatuses = $state([]); - let hiddenRings = $state(["2km", "5km"]); + let hiddenStatuses = $state(["rechtskraeftig"]); + let hiddenRings = $state([]); let mapActive = $state(false); function toggleStatus(status: string) { @@ -171,9 +171,8 @@ let areas = $state([]);
{#each [ - { status: "rechtskraeftig", color: "#2d7a45", label: t(T.windkarte_legend_rechtskraeftig) }, - { status: "entwurf_2", color: "#b08a52", label: t(T.windkarte_legend_entwurf_2) }, - { status: "entwurf_2_voraussichtlich", color: "#d4752a", label: t(T.windkarte_legend_entwurf_2_voraussichtlich) }, + { status: "rechtskraeftig", color: "#2d7a45", label: t(T.windkarte_legend_rechtskraeftig) }, + { status: "entwurf_2", color: "#b08a52", label: t(T.windkarte_legend_entwurf_2) }, ] as item}