From c8f6a7118a2ce7b066cb3f5f2f6e4db59164f01d Mon Sep 17 00:00:00 2001 From: Johannes Baumeister Date: Fri, 3 Jul 2026 20:34:28 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Add=20planungsstand=20to=20potentialfl?= =?UTF-8?q?=C3=A4chen=20and=20color=20red=20if=20rechtsverbindlich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 16 ++++++++++------ server.js | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 1b9416a..90332df 100644 --- a/app.js +++ b/app.js @@ -1245,14 +1245,18 @@ document.addEventListener('DOMContentLoaded', async () => { console.log(`Potentialflächen API: ${data.features ? data.features.length : 0} Features erhalten.`); if (data.features && data.features.length > 0) { const potLayer = L.geoJSON(data, { - style: { - color: "#00aaff", - weight: 2, - fillOpacity: 0.1, - dashArray: '5, 5' + style: (feature) => { + const isRechtsverbindlich = feature.properties?.planungsstand === 'rechtsverbindlich'; + return { + color: isRechtsverbindlich ? "#ff0000" : "#00aaff", + weight: 2, + fillOpacity: 0.1, + dashArray: '5, 5' + }; }, onEachFeature: (feature, layer) => { - layer.bindPopup(`Gebietsumring`); + const stand = feature.properties?.planungsstand || 'unbekannt'; + layer.bindPopup(`Gebietsumring
Planungsstand: ${stand}`); } }); diff --git a/server.js b/server.js index db89e8d..251e32c 100644 --- a/server.js +++ b/server.js @@ -533,7 +533,8 @@ app.get('/api/layers/potentialflaechen', async (req, res) => { 'type', 'Feature', 'geometry', ST_AsGeoJSON(ST_Transform(geom, 4326))::jsonb, 'properties', jsonb_build_object( - 'id', id + 'id', id, + 'planungsstand', planungsstand ) ) AS feature FROM geodaten."potentialflächen_wind"