feat: Add planungsstand to potentialflächen and color red if rechtsverbindlich
Deploy Standortplaner / deploy (push) Successful in 17s
Details
Deploy Standortplaner / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
4069988798
commit
c8f6a7118a
10
app.js
10
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",
|
||||
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}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue