windkarte: Rechtskräftig default hidden, remove Entwurf-2-voraussichtlich, 2km/5km rings on by default
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
<div class="min-w-0">
|
<div class="min-w-0">
|
||||||
<div class="flex items-center gap-2 flex-wrap">
|
<div class="flex items-center gap-2 flex-wrap">
|
||||||
<span class="text-xl font-semibold text-stein-800">{area.gebiets_nr}</span>
|
<span class="text-xl font-semibold text-stein-800">{area.gebiets_nr}</span>
|
||||||
{#if area.status}
|
{#if area.status && area.status !== 'rechtskraeftig'}
|
||||||
<span class="rounded-full px-2 py-0.5 text-xs font-medium {STATUS_CLASS[area.status] ?? 'bg-stein-100 text-stein-600'}">
|
<span class="rounded-full px-2 py-0.5 text-xs font-medium {STATUS_CLASS[area.status] ?? 'bg-stein-100 text-stein-600'}">
|
||||||
{t(STATUS_KEY[area.status] ?? area.status)}
|
{t(STATUS_KEY[area.status] ?? area.status)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
onready = null,
|
onready = null,
|
||||||
initialGebietsNr = null,
|
initialGebietsNr = null,
|
||||||
hiddenStatuses = [],
|
hiddenStatuses = [],
|
||||||
hiddenRings = ["2km", "5km"],
|
hiddenRings = [],
|
||||||
}: {
|
}: {
|
||||||
areas: WindArea[];
|
areas: WindArea[];
|
||||||
onselect: (area: WindArea | null, center: [number, number] | null) => void;
|
onselect: (area: WindArea | null, center: [number, number] | null) => void;
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
let selectedSlug = $state<string | null>(null);
|
let selectedSlug = $state<string | null>(null);
|
||||||
let geojsonLayer: import("leaflet").GeoJSON | null = null;
|
let geojsonLayer: import("leaflet").GeoJSON | null = null;
|
||||||
let buffering = $state(false);
|
let buffering = $state(false);
|
||||||
let _hiddenRings: string[] = ["2km", "5km"];
|
let _hiddenRings: string[] = [];
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
_hiddenRings = hiddenRings;
|
_hiddenRings = hiddenRings;
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
map!.fitBounds((layer as import("leaflet").Polygon).getBounds(), {
|
map!.fitBounds((layer as import("leaflet").Polygon).getBounds(), {
|
||||||
paddingTopLeft: [40, 40],
|
paddingTopLeft: [40, 40],
|
||||||
paddingBottomRight: [desktop ? 320 : 40, desktop ? 40 : 300],
|
paddingBottomRight: [desktop ? 320 : 40, desktop ? 40 : 300],
|
||||||
maxZoom: 12,
|
maxZoom: 11,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,6 +278,8 @@
|
|||||||
},
|
},
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
restyleAll(selectedSlug);
|
||||||
|
|
||||||
// Labels: show from zoom 13, scale font proportionally with zoom
|
// Labels: show from zoom 13, scale font proportionally with zoom
|
||||||
const syncLabels = () => {
|
const syncLabels = () => {
|
||||||
if (!labelLayer || !map) return;
|
if (!labelLayer || !map) return;
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ let areas = $state<WindArea[]>([]);
|
|||||||
let mapReady = $state(false);
|
let mapReady = $state(false);
|
||||||
let initialGebietsNr = $state<string | null>(null);
|
let initialGebietsNr = $state<string | null>(null);
|
||||||
let resetMap: (() => void) | null = null;
|
let resetMap: (() => void) | null = null;
|
||||||
let hiddenStatuses = $state<string[]>([]);
|
let hiddenStatuses = $state<string[]>(["rechtskraeftig"]);
|
||||||
let hiddenRings = $state<string[]>(["2km", "5km"]);
|
let hiddenRings = $state<string[]>([]);
|
||||||
let mapActive = $state(false);
|
let mapActive = $state(false);
|
||||||
|
|
||||||
function toggleStatus(status: string) {
|
function toggleStatus(status: string) {
|
||||||
@@ -171,9 +171,8 @@ let areas = $state<WindArea[]>([]);
|
|||||||
<!-- Legend -->
|
<!-- Legend -->
|
||||||
<div class="mt-2 flex flex-wrap gap-x-5 gap-y-1.5 text-xs text-stein-400">
|
<div class="mt-2 flex flex-wrap gap-x-5 gap-y-1.5 text-xs text-stein-400">
|
||||||
{#each [
|
{#each [
|
||||||
{ status: "rechtskraeftig", color: "#2d7a45", label: t(T.windkarte_legend_rechtskraeftig) },
|
{ 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", color: "#b08a52", label: t(T.windkarte_legend_entwurf_2) },
|
||||||
{ status: "entwurf_2_voraussichtlich", color: "#d4752a", label: t(T.windkarte_legend_entwurf_2_voraussichtlich) },
|
|
||||||
] as item}
|
] as item}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
Reference in New Issue
Block a user