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
16
app.js
16
app.js
|
|
@ -1245,14 +1245,18 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
console.log(`Potentialflächen API: ${data.features ? data.features.length : 0} Features erhalten.`);
|
console.log(`Potentialflächen API: ${data.features ? data.features.length : 0} Features erhalten.`);
|
||||||
if (data.features && data.features.length > 0) {
|
if (data.features && data.features.length > 0) {
|
||||||
const potLayer = L.geoJSON(data, {
|
const potLayer = L.geoJSON(data, {
|
||||||
style: {
|
style: (feature) => {
|
||||||
color: "#00aaff",
|
const isRechtsverbindlich = feature.properties?.planungsstand === 'rechtsverbindlich';
|
||||||
weight: 2,
|
return {
|
||||||
fillOpacity: 0.1,
|
color: isRechtsverbindlich ? "#ff0000" : "#00aaff",
|
||||||
dashArray: '5, 5'
|
weight: 2,
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
dashArray: '5, 5'
|
||||||
|
};
|
||||||
},
|
},
|
||||||
onEachFeature: (feature, layer) => {
|
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',
|
'type', 'Feature',
|
||||||
'geometry', ST_AsGeoJSON(ST_Transform(geom, 4326))::jsonb,
|
'geometry', ST_AsGeoJSON(ST_Transform(geom, 4326))::jsonb,
|
||||||
'properties', jsonb_build_object(
|
'properties', jsonb_build_object(
|
||||||
'id', id
|
'id', id,
|
||||||
|
'planungsstand', planungsstand
|
||||||
)
|
)
|
||||||
) AS feature
|
) AS feature
|
||||||
FROM geodaten."potentialflächen_wind"
|
FROM geodaten."potentialflächen_wind"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue