POI hinzufügen in useMapContextMenu.js aber noch kein Logik

This commit is contained in:
Ismail Ali
2025-03-08 22:33:20 +01:00
parent d6a95f8885
commit c227b57f9b
3 changed files with 19 additions and 1 deletions

View File

@@ -1024,6 +1024,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
useInitGisSystemStatic();
//--------------------------------------
//---------------------------------------
return (

View File

@@ -55,6 +55,23 @@ const addItemsToMapContextMenu = (map, menuItemAdded, setMenuItemAdded, openPopu
setMenuItemAdded(true);
}
if (!menuItemAdded && map && map.contextmenu) {
const editMode = localStorage.getItem("editMode") === "true";
if (editMode) {
console.log("map :", map);
console.log("editMode localStorage:", localStorage.getItem("editMode"));
console.log("editMode:", editMode);
map.contextmenu.addItem({
text: "POI hinzufügen",
icon: "/img/add_station.png",
callback: (e) => {
alert("POI hinzufügen an: " + e.latlng.lat + ", " + e.latlng.lng);
// Falls du ein Modal-Fenster zum Hinzufügen verwenden möchtest:
// ShowAddStationPopup({ latlng: e.latlng, onClose: () => {} });
},
});
}
}
};
export default addItemsToMapContextMenu;

View File

@@ -1,2 +1,2 @@
// /config/appVersion
export const APP_VERSION = "1.1.30";
export const APP_VERSION = "1.1.31";