fix: Area-Marker (Bereiche) können jetzt nur noch verschoben werden, wenn in localStorage der Wert "editMode" auf "true" gesetzt ist. Andernfalls sind sie nicht verschiebbar.
This commit is contained in:
@@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=true
|
||||
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.331
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.332
|
||||
|
||||
@@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.331
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.332
|
||||
|
||||
@@ -71,10 +71,11 @@ const useAreaMarkersLayer = (map, oms, apiUrl, onUpdateSuccess) => {
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
const markers = data.map(item => {
|
||||
const marker = L.marker([item.x, item.y], {
|
||||
icon: customIcon,
|
||||
draggable: true,
|
||||
draggable: editMode,
|
||||
customType: "areaMarker",
|
||||
});
|
||||
|
||||
@@ -88,6 +89,7 @@ const useAreaMarkersLayer = (map, oms, apiUrl, onUpdateSuccess) => {
|
||||
}
|
||||
);
|
||||
|
||||
if (editMode) {
|
||||
marker.on("dragend", async e => {
|
||||
const { lat, lng } = e.target.getLatLng();
|
||||
try {
|
||||
@@ -106,6 +108,7 @@ const useAreaMarkersLayer = (map, oms, apiUrl, onUpdateSuccess) => {
|
||||
console.error("❌ Fehler beim Aktualisieren der Koordinaten:", error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return marker;
|
||||
});
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.331",
|
||||
"version": "1.1.332",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodemap",
|
||||
"version": "1.1.331",
|
||||
"version": "1.1.332",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.331",
|
||||
"version": "1.1.332",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
Reference in New Issue
Block a user