Kontextmenü Item "POI Bearbeiten", "POI hinzufügen" und "Stützpunkt hinzufügen" ausblenden wenn localStorage Variable "editMode" false ist
This commit is contained in:
@@ -69,14 +69,16 @@ export const addItemsToMapContextMenu = (map, menuItemAdded, setMenuItemAdded, h
|
||||
callback: (e) => centerHereCallback(e, map),
|
||||
});
|
||||
|
||||
map.contextmenu.addItem({ separator: true });
|
||||
|
||||
map.contextmenu.addItem({
|
||||
text: "POI hinzufügen",
|
||||
icon: "img/add_station.png",
|
||||
className: "background-red",
|
||||
callback: (event) => addStationCallback(event, hasRights, setShowPopup, setPopupCoordinates),
|
||||
});
|
||||
// wenn localStorage Variable editMode true ist, dann wird der Button "POI hinzufügen" angezeigt
|
||||
if (editMode) {
|
||||
map.contextmenu.addItem({ separator: true });
|
||||
map.contextmenu.addItem({
|
||||
text: "POI hinzufügen",
|
||||
icon: "img/add_station.png",
|
||||
className: "background-red",
|
||||
callback: (event) => addStationCallback(event, hasRights, setShowPopup, setPopupCoordinates),
|
||||
});
|
||||
}
|
||||
|
||||
setMenuItemAdded(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user