fix: Leistung etwas verbessert wegen Kabelstrecken anzeigen und ausblenden
This commit is contained in:
@@ -153,7 +153,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const [oms, setOms] = useState(null); // State für OMS-Instanz
|
||||
|
||||
// Flag, ob Nutzer die Polyline-Checkbox manuell betätigt hat
|
||||
const userToggledPolyline = useRef(false);
|
||||
// Nutzer-Flag global auf window, damit auch Redux darauf zugreifen kann
|
||||
if (typeof window !== "undefined" && window.userToggledPolyline === undefined) {
|
||||
window.userToggledPolyline = false;
|
||||
}
|
||||
|
||||
//-----userRights----------------
|
||||
const isRightsLoaded = useSelector(
|
||||
@@ -305,7 +308,9 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
// Callback für Checkbox-Umschaltung (Kabelstrecken)
|
||||
const handlePolylineCheckboxChange = useCallback(
|
||||
checked => {
|
||||
userToggledPolyline.current = true;
|
||||
if (typeof window !== "undefined") {
|
||||
window.userToggledPolyline = true;
|
||||
}
|
||||
dispatch(setPolylineVisible(checked));
|
||||
},
|
||||
[dispatch]
|
||||
@@ -1031,7 +1036,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
</div>
|
||||
|
||||
{GisStationsStaticDistrict && GisStationsStaticDistrict.Points?.length > 0 && (
|
||||
<MapLayersControlPanel className="z-50" />
|
||||
<MapLayersControlPanel
|
||||
className="z-50"
|
||||
handlePolylineCheckboxChange={handlePolylineCheckboxChange}
|
||||
/>
|
||||
)}
|
||||
|
||||
<CoordinateInput onCoordinatesSubmit={handleCoordinatesSubmit} />
|
||||
|
||||
Reference in New Issue
Block a user