Merge branch 'v306' into develop
This commit is contained in:
@@ -70,7 +70,7 @@ const useDynamicDeviceLayers = (map, GisSystemStatic, mapLayersVisibility, prior
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
|
||||
Object.entries(markerStates).forEach(([key, markers]) => {
|
||||
const isVisible = mapLayersVisibility[key];
|
||||
const isVisible = mapLayersVisibility[key] ?? true; // undefined = true
|
||||
|
||||
markers.forEach(marker => {
|
||||
const hasLayer = map.hasLayer(marker);
|
||||
|
||||
0
components/hooks/useStationCache.js
Normal file
0
components/hooks/useStationCache.js
Normal file
@@ -834,30 +834,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
}
|
||||
}, [poiIconsData, poiIconsStatus]);
|
||||
//-----------------------------------------------------------------
|
||||
useEffect(() => {
|
||||
if (!map) return;
|
||||
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
|
||||
Object.entries(markerStates).forEach(([systemName, markers]) => {
|
||||
const isVisible = mapLayersVisibility[systemName];
|
||||
markers.forEach(marker => {
|
||||
const hasLayer = map.hasLayer(marker);
|
||||
if (editMode || !isVisible) {
|
||||
if (hasLayer) map.removeLayer(marker);
|
||||
} else {
|
||||
if (!hasLayer) marker.addTo(map);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// optional für alle zusammen
|
||||
const allMarkers = Object.values(markerStates)
|
||||
.filter(entry => Array.isArray(entry))
|
||||
.flat();
|
||||
|
||||
checkOverlappingMarkers(map, allMarkers, plusRoundIcon);
|
||||
}, [map, markerStates, mapLayersVisibility]);
|
||||
|
||||
//----------------------------------------------
|
||||
useEffect(() => {
|
||||
@@ -933,6 +909,21 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
}, [GisStationsStaticDistrict]);
|
||||
const { Points = [] } = useSelector(selectGisStationsStaticDistrict);
|
||||
useEffect(() => {}, [triggerUpdate]);
|
||||
//--------------------------------------------------------------------------------
|
||||
useEffect(() => {
|
||||
console.log("📊 GisSystemStatic:", GisSystemStatic);
|
||||
}, [GisSystemStatic]);
|
||||
useEffect(() => {
|
||||
if (Array.isArray(GisSystemStatic)) {
|
||||
GisSystemStatic.forEach(system => {
|
||||
const key = `system-${system.IdSystem}`;
|
||||
if (!(key in mapLayersVisibility)) {
|
||||
dispatch(setLayerVisibility({ key, value: true })); // Sichtbarkeit aktivieren
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [GisSystemStatic, mapLayersVisibility, dispatch]);
|
||||
|
||||
//---------------------------------------------
|
||||
//--------------------------------------------
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user