POI hinzufügen in useMapContextMenu.js aber noch kein Logik
This commit is contained in:
@@ -1024,6 +1024,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
useInitGisSystemStatic();
|
useInitGisSystemStatic();
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -55,6 +55,23 @@ const addItemsToMapContextMenu = (map, menuItemAdded, setMenuItemAdded, openPopu
|
|||||||
|
|
||||||
setMenuItemAdded(true);
|
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;
|
export default addItemsToMapContextMenu;
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
// /config/appVersion
|
// /config/appVersion
|
||||||
export const APP_VERSION = "1.1.30";
|
export const APP_VERSION = "1.1.31";
|
||||||
|
|||||||
Reference in New Issue
Block a user