diff --git a/components/MapComponent.js b/components/MapComponent.js index 8af733533..a04a9dec8 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -281,14 +281,14 @@ const MapComponent = ({ locations, onLocationUpdate }) => { }, [mapRef, map]); // Abhängigkeiten prüfen // Marker hinzufügen von lokale MySQL Datenbank und nicht von APIs - /* useEffect(() => { + useEffect(() => { // Remove old markers if (map) { - map.eachLayer((layer) => { + /* map.eachLayer((layer) => { if (layer instanceof L.Marker) { map.removeLayer(layer); } - }); + }); */ // Add new markers locations.forEach((location) => { @@ -324,7 +324,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.addTo(map); }); } - }, [map, locations, onLocationUpdate]); */ + }, [map, locations, onLocationUpdate]); //------------------------------------------ function parsePoint(pointString) { @@ -559,11 +559,11 @@ const MapComponent = ({ locations, onLocationUpdate }) => { // Alte Marker entfernen, indem alle Marker, die durch OMS verwaltet werden, gelöscht werden oms.clearMarkers(); - map.eachLayer((layer) => { + /* map.eachLayer((layer) => { if (layer instanceof L.Marker) { map.removeLayer(layer); } - }); + }); */ // Neue Marker für jede Station hinzufügen GisStationsStaticDistrict.forEach((station) => {