Show Marker from database
This commit is contained in:
@@ -281,14 +281,14 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
|||||||
}, [mapRef, map]); // Abhängigkeiten prüfen
|
}, [mapRef, map]); // Abhängigkeiten prüfen
|
||||||
|
|
||||||
// Marker hinzufügen von lokale MySQL Datenbank und nicht von APIs
|
// Marker hinzufügen von lokale MySQL Datenbank und nicht von APIs
|
||||||
/* useEffect(() => {
|
useEffect(() => {
|
||||||
// Remove old markers
|
// Remove old markers
|
||||||
if (map) {
|
if (map) {
|
||||||
map.eachLayer((layer) => {
|
/* map.eachLayer((layer) => {
|
||||||
if (layer instanceof L.Marker) {
|
if (layer instanceof L.Marker) {
|
||||||
map.removeLayer(layer);
|
map.removeLayer(layer);
|
||||||
}
|
}
|
||||||
});
|
}); */
|
||||||
|
|
||||||
// Add new markers
|
// Add new markers
|
||||||
locations.forEach((location) => {
|
locations.forEach((location) => {
|
||||||
@@ -324,7 +324,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
|||||||
marker.addTo(map);
|
marker.addTo(map);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [map, locations, onLocationUpdate]); */
|
}, [map, locations, onLocationUpdate]);
|
||||||
|
|
||||||
//------------------------------------------
|
//------------------------------------------
|
||||||
function parsePoint(pointString) {
|
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
|
// Alte Marker entfernen, indem alle Marker, die durch OMS verwaltet werden, gelöscht werden
|
||||||
oms.clearMarkers();
|
oms.clearMarkers();
|
||||||
map.eachLayer((layer) => {
|
/* map.eachLayer((layer) => {
|
||||||
if (layer instanceof L.Marker) {
|
if (layer instanceof L.Marker) {
|
||||||
map.removeLayer(layer);
|
map.removeLayer(layer);
|
||||||
}
|
}
|
||||||
});
|
}); */
|
||||||
|
|
||||||
// Neue Marker für jede Station hinzufügen
|
// Neue Marker für jede Station hinzufügen
|
||||||
GisStationsStaticDistrict.forEach((station) => {
|
GisStationsStaticDistrict.forEach((station) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user