WIP: Add basic structure for edit mode to DataSheet.js
Der Bearbeitungsmodus ist noch nicht vollständig, und es fehlen einige Funktionalitäten. Reduzierung der Datenbankanfragen noch in Arbeit.
This commit is contained in:
@@ -19,6 +19,8 @@ const showCoordinates = (e) => {
|
||||
};
|
||||
// Kontextmenü Callback für "POI hinzufügen"
|
||||
const addStationCallback = (event, hasRights, setShowPopup, setPopupCoordinates) => {
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
hasRights = editMode ? hasRights : undefined;
|
||||
if (hasRights) {
|
||||
setPopupCoordinates(event.latlng);
|
||||
setShowPopup(true);
|
||||
@@ -36,6 +38,10 @@ const addStationCallback = (event, hasRights, setShowPopup, setPopupCoordinates)
|
||||
};
|
||||
|
||||
export const addItemsToMapContextMenu = (map, menuItemAdded, setMenuItemAdded, hasRights, setShowPopup, setPopupCoordinates) => {
|
||||
// Überprüfe den Bearbeitungsmodus in localStorage
|
||||
const editMode = localStorage.getItem("editMode") === "true";
|
||||
hasRights = editMode ? hasRights : undefined;
|
||||
|
||||
if (!menuItemAdded && map && map.contextmenu) {
|
||||
map.contextmenu.addItem({
|
||||
text: "Koordinaten anzeigen",
|
||||
|
||||
Reference in New Issue
Block a user