feat: Marker-Cleanup zur Vermeidung von Memory Leaks implementiert

- cleanupMarkers() Utility in /utils/common/cleanupMarkers.js erstellt
- Marker-Cleanup in MapComponent.js vor createAndSetDevices() integriert
- createAndSetDevices.js von Cleanup-Verantwortung befreit (reine Erzeugung)
- setupPOIs.js erweitert um cleanupMarkers() vor Layer-Neuerstellung
- poiUtils.js und markerUtils.js angepasst: cleanupMarkers() ersetzt .remove()
- Memory Leaks durch verwaiste Tooltips, Events und Marker behoben
- Grundlage für wiederverwendbare Marker-Cleanup-Logik für POIs, Geräte, Linien geschaffen
This commit is contained in:
ISA
2025-06-06 10:21:56 +02:00
parent ec31b36b3d
commit f7f7122620
10 changed files with 160 additions and 55 deletions

View File

@@ -48,7 +48,7 @@ const useAreaMarkersLayer = (map, oms, apiUrl, onUpdateSuccess) => {
};
window.addEventListener("storage", handleStorageChange);
const intervalId = setInterval(updateMarkersVisibility, 500);
const intervalId = setInterval(updateMarkersVisibility, 5000);
return () => {
window.removeEventListener("storage", handleStorageChange);
@@ -68,6 +68,7 @@ const useAreaMarkersLayer = (map, oms, apiUrl, onUpdateSuccess) => {
const marker = L.marker([item.x, item.y], {
icon: customIcon,
draggable: true,
customType: "areaMarker",
});
marker.bindTooltip(