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) => {