WIP. polylines visiblity

This commit is contained in:
ISA
2025-08-21 09:47:03 +02:00
parent 2066cbb9e8
commit 2da79c9318
6 changed files with 11 additions and 6 deletions

View File

@@ -374,6 +374,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
return;
}
// Prüfe Sichtbarkeit aus localStorage und Redux
const localStoragePolylineVisible = localStorage.getItem("polylineVisible") === "true";
const reduxPolylineLayerVisible = poiLayerVisible; // redux: polylineLayerVisible.visible
// vorherige Marker & Polylinien vollständig bereinigen
(Array.isArray(markers) ? markers : []).forEach(marker => {
marker.remove();
@@ -382,7 +386,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
// Setze neue Marker und Polylinien mit den aktuellen Daten (asynchron!)
const updatePolylines = async () => {
if (polylineVisible) {
if (localStoragePolylineVisible && reduxPolylineLayerVisible) {
const { markers: newMarkers, polylines: newPolylines } = await setupPolylines(
map,
linePositions,
@@ -456,6 +460,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
tempMarker,
polylineVisible,
isTalasAllowed,
poiLayerVisible,
]);
//--------------------------------------------