feat: Kontextmenü für Stützpunkte nur im Edit-Mode anzeigen
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.57";
|
export const APP_VERSION = "1.1.58";
|
||||||
|
|||||||
@@ -138,13 +138,13 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents,
|
|||||||
});
|
});
|
||||||
|
|
||||||
marker.on("mouseover", function () {
|
marker.on("mouseover", function () {
|
||||||
this.bindContextMenu({
|
if (editMode) {
|
||||||
contextmenuItems: [
|
this.bindContextMenu({
|
||||||
{
|
contextmenuItems: [
|
||||||
text: "Stützpunkt entfernen",
|
{
|
||||||
icon: "/img/icons/gisLines/remove-support-point.svg",
|
text: "Stützpunkt entfernen",
|
||||||
callback: () => {
|
icon: "/img/icons/gisLines/remove-support-point.svg",
|
||||||
if (editMode) {
|
callback: () => {
|
||||||
const newCoords = marker.getLatLng();
|
const newCoords = marker.getLatLng();
|
||||||
const newCoordinates = [...lineData.coordinates];
|
const newCoordinates = [...lineData.coordinates];
|
||||||
newCoordinates[index] = [newCoords.lat, newCoords.lng];
|
newCoordinates[index] = [newCoords.lat, newCoords.lng];
|
||||||
@@ -152,21 +152,11 @@ export const setupPolylines = (map, linePositions, lineColors, tooltipContents,
|
|||||||
removePOI(marker, lineData, currentZoom, currentCenter);
|
removePOI(marker, lineData, currentZoom, currentCenter);
|
||||||
polylines[lineIndex].remove();
|
polylines[lineIndex].remove();
|
||||||
lineData.coordinates = newCoordinates;
|
lineData.coordinates = newCoordinates;
|
||||||
} else {
|
},
|
||||||
toast.error("Benutzer hat keine Berechtigung zum Bearbeiten.", {
|
|
||||||
position: "top-center",
|
|
||||||
autoClose: 5000,
|
|
||||||
hideProgressBar: false,
|
|
||||||
closeOnClick: true,
|
|
||||||
pauseOnHover: true,
|
|
||||||
draggable: true,
|
|
||||||
progress: undefined,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
marker.on("mouseout", function () {
|
marker.on("mouseout", function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user