WIP: Marker ausblenden mit editMode
This commit is contained in:
@@ -425,12 +425,30 @@ await fetchGisStationsStatusDistrict(mapGisStationsStatusDistrictUrl, setGisStat
|
||||
...tkComponentsMarkers,
|
||||
...ulafMarkers,
|
||||
];
|
||||
|
||||
const editMode = localStorage.getItem("editMode") === "true"; // EditMode prüfen
|
||||
|
||||
if (editMode) {
|
||||
// Alle Marker entfernen, wenn EditMode aktiv ist
|
||||
allMarkers.forEach((marker) => {
|
||||
if (map.hasLayer(marker)) {
|
||||
map.removeLayer(marker);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Marker wieder hinzufügen, falls EditMode deaktiviert ist
|
||||
allMarkers.forEach((marker) => {
|
||||
if (!map.hasLayer(marker)) {
|
||||
marker.addTo(map);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Überprüfe überlappende Marker und füge das "Plus"-Icon hinzu
|
||||
checkOverlappingMarkers(map, allMarkers, plusRoundIcon);
|
||||
}
|
||||
}, [
|
||||
map,
|
||||
mapLayersVisibility,
|
||||
talasMarkers,
|
||||
eciMarkers,
|
||||
gsmModemMarkers,
|
||||
@@ -682,12 +700,12 @@ await fetchGisStationsStatusDistrict(mapGisStationsStatusDistrictUrl, setGisStat
|
||||
updateGmaData();
|
||||
|
||||
// Setze ein Intervall, um die Daten alle 5 Sekunden zu aktualisieren
|
||||
const intervalId = setInterval(() => {
|
||||
/* const intervalId = setInterval(() => {
|
||||
updateGmaData();
|
||||
}, 5000);
|
||||
|
||||
// Cleanup-Funktion, um das Intervall zu entfernen, wenn die Komponente entladen wird
|
||||
return () => clearInterval(intervalId);
|
||||
return () => clearInterval(intervalId); */
|
||||
}, [map, gmaMarkers, layers.MAP_LAYERS.GMA, oms, mapGisStationsMeasurementsUrl]);
|
||||
|
||||
//---------------------------------
|
||||
@@ -766,7 +784,7 @@ await fetchGisStationsStatusDistrict(mapGisStationsStatusDistrictUrl, setGisStat
|
||||
updateAllMarkers();
|
||||
|
||||
// Setze ein Intervall für regelmäßige Updates
|
||||
const intervalId = setInterval(() => {
|
||||
/* const intervalId = setInterval(() => {
|
||||
updateAllMarkers();
|
||||
}, 60000); // 20 Sekunden
|
||||
|
||||
@@ -780,7 +798,7 @@ await fetchGisStationsStatusDistrict(mapGisStationsStatusDistrictUrl, setGisStat
|
||||
ref.current.clearLayers();
|
||||
}
|
||||
});
|
||||
};
|
||||
}; */
|
||||
}, [gisSystemStaticLoaded, map, GisSystemStatic, priorityConfig]);
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user