fix: Kabelstrecken werden ausgeblendet

This commit is contained in:
ISA
2025-08-22 09:46:31 +02:00
parent bf7b62d110
commit f2a322a91b
8 changed files with 82 additions and 36 deletions

View File

@@ -37,19 +37,15 @@ export const setupPolylines = async (
basePath = config.basePath || "";
}
} catch (e) {}
if (!polylineVisible) {
//console.warn("Polylines deaktiviert - keine Zeichnung");
return { markers: [], polylines: [] };
}
if (!polylineVisible) {
// Entferne alle Polylinien, wenn sie ausgeblendet werden sollen
if (window.polylines) {
window.polylines.forEach(polyline => {
if (map.hasLayer(polyline)) {
if (map && map.hasLayer(polyline)) {
map.removeLayer(polyline);
}
});
window.polylines = [];
}
return { markers: [], polylines: [] };
}