Compare commits

..

No commits in common. "08019238e13bdacfdca39039f7c2a7b8e71b119e" and "3211aff84098140c4baa548f3aaafb3d1401d1bb" have entirely different histories.

1 changed files with 9 additions and 18 deletions

View File

@ -1519,24 +1519,16 @@
const statusEl = document.getElementById('status-usage');
// Filtering: Expanded list and more robust matching
const requestedKeywords = [
'gehölz', 'wald', 'forst', 'bahn', 'verkehr', 'straße', 'baufläche', 'wohnbau',
'weg', 'gewässer', 'wasser', 'grünland', 'landwirtsch', 'acker'
];
// Filtering: Only show requested types
const requestedTypes = ['gehölz', 'wald', 'bahnverkehr', 'straßenverkehr', 'wohnbafläche', 'weg', 'fließgewässer', 'stehendes gewässer', 'gewässer'];
const filteredFeatures = state.usage.features.filter(f => {
const props = f.properties;
const rawType = props.nutzart || props.NUTZART || props.bezeichnung || props.BEZEICHNUN || props.nutzungsart || '';
const type = rawType.toLowerCase();
return requestedKeywords.some(kw => type.includes(kw));
const type = (f.properties.nutzart || f.properties.NUTZART || '').toLowerCase();
return requestedTypes.some(rt => type.includes(rt));
});
console.log(`Nutzung-Layer: ${filteredFeatures.length} von ${state.usage.features.length} Objekten nach Filterung.`);
if (statusEl) {
statusEl.innerText = `${filteredFeatures.length} Objekte`;
statusEl.style.color = filteredFeatures.length > 0 ? 'var(--success)' : 'var(--warning)';
statusEl.style.color = 'var(--success)';
}
layers.usage.clearLayers();
@ -1545,11 +1537,10 @@
type: "FeatureCollection",
features: filteredFeatures
});
if (layers.usage.getBounds().isValid() && filteredFeatures.length > 0) {
console.log("Zooming to Usage layer...");
// map.fitBounds(layers.usage.getBounds()); // Optional: Auto-zoom to usage
}
}
if (layers.usage.getBounds().isValid() && state.visibleLayers.usage && filteredFeatures.length > 0) {
map.fitBounds(layers.usage.getBounds());
}
}