muss noch für update der Bereich Marker gearbeitet werden
This commit is contained in:
@@ -43,7 +43,7 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
/* useEffect(() => {
|
||||
// Hole die Daten aus der API
|
||||
const fetchBereiche = async () => {
|
||||
try {
|
||||
@@ -82,7 +82,7 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
};
|
||||
|
||||
fetchBereiche();
|
||||
}, [apiUrl]);
|
||||
}, [apiUrl]); */
|
||||
|
||||
useEffect(() => {
|
||||
// Initialisiere die Sichtbarkeit beim ersten Laden
|
||||
@@ -108,7 +108,7 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
clearInterval(intervalId);
|
||||
};
|
||||
}, [map, bereicheMarkers, oms]);
|
||||
/*
|
||||
|
||||
useEffect(() => {
|
||||
const fetchBereiche = async () => {
|
||||
try {
|
||||
@@ -124,9 +124,9 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
// Tooltip
|
||||
marker.bindTooltip(
|
||||
`
|
||||
<strong>Bereich:</strong> ${item.location_name} <br />
|
||||
<strong>Standort:</strong> ${item.area_name} <br />
|
||||
`,
|
||||
<strong>Bereich:</strong> ${item.location_name} <br />
|
||||
<strong>Standort:</strong> ${item.area_name} <br />
|
||||
`,
|
||||
{
|
||||
permanent: false,
|
||||
direction: "top",
|
||||
@@ -138,7 +138,8 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
marker.on("dragend", async (e) => {
|
||||
const { lat, lng } = e.target.getLatLng();
|
||||
try {
|
||||
await updateLocation(item.idLocation, item.idMaps, { x: lat, y: lng });
|
||||
// Update API aufrufen
|
||||
await updateLocation(item.idLocation, item.idMaps, { x: lat, y: lng }); // Update-Funktion
|
||||
console.log("Koordinaten erfolgreich aktualisiert:", { lat, lng });
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Aktualisieren der Koordinaten:", error);
|
||||
@@ -155,7 +156,7 @@ const useBereicheMarkersLayer = (map, oms, apiUrl) => {
|
||||
};
|
||||
|
||||
fetchBereiche();
|
||||
}, [apiUrl]); */
|
||||
}, [apiUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (map) {
|
||||
|
||||
Reference in New Issue
Block a user