diff --git a/components/MapComponent.js b/components/MapComponent.js index 5f15c52f8..c5c339359 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -290,16 +290,6 @@ const MapComponent = ({ locations, onLocationUpdate }) => { contextmenu: true, contextmenuItems: [ { text: "Station hinzufügen", callback: addStationCallback }, - { - text: "Station öffnen (Tab)", - icon: "img/screen_new.png", - callback: (e) => openInNewTab(e, marker), - }, - { - text: "Station öffnen", - icon: "img/screen_same.png", - callback: (e) => showCoordinates(e, marker), - }, { text: "Koordinaten", icon: "img/screen_same.png", @@ -393,7 +383,6 @@ const MapComponent = ({ locations, onLocationUpdate }) => { contextmenu: true, contextmenuWidth: 140, contextmenuItems: [ - { text: "Station hinzufügen", callback: addStationCallback }, { text: "Station öffnen (Tab)", icon: "/img/screen_new.png", @@ -404,16 +393,6 @@ const MapComponent = ({ locations, onLocationUpdate }) => { icon: "/img/screen_same.png", callback: (e) => openInSameWindow(e, marker), }, - { - text: "Koordinaten anzeigen", - icon: "/img/screen_same.png", - callback: (e) => showCoordinates(e, marker), - }, - - "-", // Divider - { text: "Reinzoomen", callback: zoomIn }, - { text: "Rauszoomen", callback: zoomOut }, - { text: "Hier zentrieren", callback: centerHere }, ], }); } @@ -442,12 +421,14 @@ const MapComponent = ({ locations, onLocationUpdate }) => { }; // Funktion zum Anzeigen der Koordinaten - function showCoordinates(e, marker) { - const latLng = marker.getLatLng(); + const showCoordinates = (e) => { alert( - `Latitude: ${latLng.lat.toFixed(5)}, Longitude: ${latLng.lng.toFixed(5)}` + "Breitengrad: " + + e.latlng.lat.toFixed(5) + + "\nLängengrad: " + + e.latlng.lng.toFixed(5) ); - } + }; const showData = (e) => {}; const showTalas = (e) => { map.addLayer(TALAS); @@ -901,6 +882,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(ECI); } @@ -922,6 +904,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(GSMModem); } @@ -943,6 +926,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(CiscoRouter); } @@ -964,6 +948,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(WAGO); @@ -987,6 +972,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(Siemens); } @@ -1008,6 +994,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(OTDR); } @@ -1029,6 +1016,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(WDM); } @@ -1110,6 +1098,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(GMA); } @@ -1132,6 +1121,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(GMA); } @@ -1153,6 +1143,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); map.addLayer(TALASICL); } @@ -1174,6 +1165,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); } }, [map, dauzMarkers]); @@ -1194,6 +1186,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); } }, [map, smsfunkmodemMarkers]); @@ -1214,6 +1207,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); } }, [map, ulafMarkers]); @@ -1234,6 +1228,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { marker.on("mouseout", function () { this.closePopup(); }); + addContextMenuToMarker(marker); }); } }, [map, sonstigeMarkers]);