From af89d6827aae3b1c39a67e02820ea1771909438a Mon Sep 17 00:00:00 2001 From: ISA Date: Mon, 6 May 2024 08:58:41 +0200 Subject: [PATCH] =?UTF-8?q?showCoordinates=20Funktion=20f=C3=BCr=20Kontext?= =?UTF-8?q?men=C3=BC=20"Koordinaten"=20und=20von=2015=20Stellen=20nach=20K?= =?UTF-8?q?omma=20nur=205=20anzeigen,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MapComponent.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/MapComponent.js b/components/MapComponent.js index 00e1ee262..6563823d9 100644 --- a/components/MapComponent.js +++ b/components/MapComponent.js @@ -294,7 +294,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => { { text: "Koordinaten", icon: "img/screen_same.png", - callback: lata, + callback: showCoordinates, }, "-", // Divider { text: "Reinzoomen", callback: zoomIn }, @@ -399,10 +399,6 @@ const MapComponent = ({ locations, onLocationUpdate }) => { .focus(); }; - const lata = (e) => { - alert("Breitengrad: " + e.latlng.lat); - }; - const zoomIn = (e) => { initMap.flyTo(e.latlng, 12); //console.log("ZoomIn koordinaten in MapComponent", e.latlng); @@ -416,7 +412,12 @@ const MapComponent = ({ locations, onLocationUpdate }) => { }; const showCoordinates = (e) => { - alert("Breitengrad: " + e.latlng.lat + "\nLängengrad: " + e.latlng.lng); + alert( + "Breitengrad: " + + e.latlng.lat.toFixed(5) + + "\nLängengrad: " + + e.latlng.lng.toFixed(5) + ); }; const showData = (e) => {}; const showTalas = (e) => {