feat: Add planungsstand to potentialflächen and color red if rechtsverbindlich
Deploy Standortplaner / deploy (push) Successful in 17s Details

This commit is contained in:
Johannes Baumeister 2026-07-03 20:34:28 +02:00
parent 4069988798
commit c8f6a7118a
2 changed files with 12 additions and 7 deletions

16
app.js
View File

@ -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(`<b>Gebietsumring</b>`);
const stand = feature.properties?.planungsstand || 'unbekannt';
layer.bindPopup(`<b>Gebietsumring</b><br>Planungsstand: ${stand}`);
}
});

View File

@ -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"