Version 1.0.2 mit node_modules Verzeichnis

This commit is contained in:
ISA
2024-10-02 07:58:24 +02:00
parent f353a06b1b
commit 62b6e55a0a
68228 changed files with 4548477 additions and 651 deletions

View File

@@ -29,6 +29,9 @@ export const setupPOIs = async (
setCurrentPoiData,
deviceName
) => {
const editMode = localStorage.getItem("editMode") === "true"; // Prüfen, ob der Bearbeitungsmodus aktiv ist
userRights = editMode ? userRights : undefined; // Nur Berechtigungen anwenden, wenn editMode true ist
if (map && poiLayerRef.current) {
map.removeLayer(poiLayerRef.current);
poiLayerRef.current = new L.LayerGroup().addTo(map);
@@ -52,28 +55,35 @@ export const setupPOIs = async (
id: location.idPoi,
name: location.name,
description: location.description,
idLD: location.idLD,
link: location.link,
}).bindContextMenu({
contextmenu: true,
contextmenuWidth: 140,
contextmenuItems: [
{
text: "POI Bearbeiten",
icon: "/img/poi-edit.png",
callback: () => handleEditPoi(marker, userRights, setCurrentPoiData, setShowPoiUpdateModal, fetchPoiData, toast),
},
],
});
// Nur das Kontextmenü "POI Bearbeiten" hinzufügen, wenn editMode true ist
if (editMode) {
marker.bindContextMenu({
contextmenu: true,
contextmenuWidth: 140,
contextmenuItems: [
{
text: "POI Bearbeiten",
icon: "/img/poi-edit.png",
callback: () => handleEditPoi(marker, userRights, setCurrentPoiData, setShowPoiUpdateModal, fetchPoiData, toast),
},
],
});
}
marker.bindPopup(`
<div>
<b class="text-xl text-black-700">${location.description || "Unbekannt"}</b><br>
${deviceName}<br>
${poiTypName}<br>
</div>
`);
<div>
<b class="text-xl text-black-700">${location.description || "Unbekannt"}</b><br>
${deviceName || "unbekannt"} <br>
${poiTypName}<br>
</div>
`);
marker.on("mouseover", function () {
console.log("Device Name:", marker); // Debugging
handlePoiSelect(
{
id: location.idPoi,
@@ -81,18 +91,14 @@ export const setupPOIs = async (
idPoiTyp: location.idPoiTyp,
typ: poiTypName,
description: location.description,
idLD: location.idLD,
},
setSelectedPoi,
setLocationDeviceData,
setDeviceName,
setDeviceName, // Stelle sicher, dass dies korrekt funktioniert
poiLayerRef,
poiTypMap
);
setCurrentPoi(location);
this.openPopup();
// Deaktiviere Polyline-Ereignisse beim Öffnen des Kontextmenüs des Markers
//disablePolylineEvents(window.polylines);
localStorage.setItem("lastElementType", "marker");
localStorage.setItem("markerLink", this.options.link);
@@ -103,6 +109,7 @@ export const setupPOIs = async (
});
marker.on("dragend", (e) => {
console.log("Marker wurde verschoben in setupPOIs");
if (canDrag) {
const newLat = e.target.getLatLng().lat;
const newLng = e.target.getLatLng().lng;