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"