diff --git a/.env.development b/.env.development index 338e7e788..9a7be6e8c 100644 --- a/.env.development +++ b/.env.development @@ -23,4 +23,4 @@ NEXT_PUBLIC_USE_MOCKS=true # z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen # basePath wird jetzt in public/config.json gepflegt # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.367 +NEXT_PUBLIC_APP_VERSION=1.1.368 diff --git a/.env.production b/.env.production index 0ceca8209..46894803c 100644 --- a/.env.production +++ b/.env.production @@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=false # basePath wird jetzt in public/config.json gepflegt # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.1.367 +NEXT_PUBLIC_APP_VERSION=1.1.368 diff --git a/components/mainComponent/MapComponent.js b/components/mainComponent/MapComponent.js index 7d461b20d..31db1c3d9 100644 --- a/components/mainComponent/MapComponent.js +++ b/components/mainComponent/MapComponent.js @@ -165,7 +165,14 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { const [showVersionInfoModal, setShowVersionInfoModal] = useState(false); const [poiTypMap, setPoiTypMap] = useState(new Map()); const [showPopup, setShowPopup] = useState(false); - const [showAreaDropdown, setShowAreaDropdown] = useState(false); + const [showAreaDropdown, setShowAreaDropdown] = useState(() => { + try { + const v = localStorage.getItem("showAreaDropdown"); + return v === null ? false : v === "true"; + } catch (_) { + return false; + } + }); const poiLayerRef = useRef(null); // Referenz auf die Layer-Gruppe für Datenbank-Marker const mapRef = useRef(null); // Referenz auf das DIV-Element der Karte const [map, setMap] = useState(null); // Zustand der Karteninstanz @@ -199,6 +206,29 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { } }); + // Zentrale Steuerung: Nur ein Overlay gleichzeitig + // Mögliche Werte: null | 'area' | 'layers' | 'coord' | 'info' + const [overlay, setOverlay] = useState(null); + + // Initiale Bestimmung des aktiven Overlays basierend auf bestehenden Flags + useEffect(() => { + if (showAreaDropdown) setOverlay("area"); + else if (showLayersPanel) setOverlay("layers"); + else if (showCoordinateInput) setOverlay("coord"); + else if (showAppInfoCard) setOverlay("info"); + else setOverlay(null); + // nur beim Mount ausführen + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // Flags mit Overlay-State synchronisieren (persistiert weiterhin in bestehenden Effects) + useEffect(() => { + setShowAreaDropdown(overlay === "area"); + setShowLayersPanel(overlay === "layers"); + setShowCoordinateInput(overlay === "coord"); + setShowAppInfoCard(overlay === "info"); + }, [overlay]); + // Flag, ob Nutzer die Polyline-Checkbox manuell betätigt hat // Nutzer-Flag global auf window, damit auch Redux darauf zugreifen kann if (typeof window !== "undefined" && window.userToggledPolyline === undefined) { @@ -270,6 +300,12 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { localStorage.setItem("showAppInfoCard", String(showAppInfoCard)); } catch (_) {} }, [showAppInfoCard]); + // Persistiere Sichtbarkeit des Area-Dropdowns (Marker-Overlay) + useEffect(() => { + try { + localStorage.setItem("showAreaDropdown", String(showAreaDropdown)); + } catch (_) {} + }, [showAreaDropdown]); // Persistiere Sichtbarkeit des Layer-Panels useEffect(() => { try { @@ -1160,23 +1196,17 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { )} {/* Marker-Icon (line-md) */} - {showAreaDropdown && setShowAreaDropdown(false)} />} + {overlay === "area" && setOverlay(null)} />} {/*Lupe: Koordinatensuche ein-/ausblenden */} {/* Lupe: Koordinaten-Suche ein-/ausblenden */}