fix: GMA Tooltip Kontextmenü funktioniert
This commit is contained in:
@@ -3,20 +3,21 @@ import { addContextMenuToMarker } from "../../utils/addContextMenuToMarker";
|
||||
import { addItemsToMapContextMenu } from "../../components/useMapContextMenu"; // Importiere die Funktion
|
||||
|
||||
const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isVisible) => {
|
||||
const zoomIn = (e, map) => {
|
||||
const zoomIn = (map, latlng) => {
|
||||
if (!map) {
|
||||
console.error("map is not defined in zoomIn");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const currentZoom = map.getZoom();
|
||||
|
||||
|
||||
if (currentZoom < 14) {
|
||||
map.flyTo(e.latlng, 14);
|
||||
localStorage.setItem("mapZoom", 16);
|
||||
map.flyTo(latlng, 14);
|
||||
localStorage.setItem("mapZoom", 14);
|
||||
localStorage.setItem("mapCenter", JSON.stringify(map.getCenter()));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const zoomOut = (map) => {
|
||||
if (!map) {
|
||||
@@ -137,7 +138,10 @@ const useGmaMarkersLayer = (map, markers, GisStationsMeasurements, GMA, oms, isV
|
||||
{
|
||||
text: "Reinzoomen",
|
||||
icon: "img/zoom_in.png",
|
||||
callback: () => zoomIn(map),
|
||||
callback: () => {
|
||||
const latlng = marker.getLatLng(); // Hole die Koordinaten direkt vom Marker
|
||||
zoomIn(map, latlng);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Rauszoomen",
|
||||
|
||||
Reference in New Issue
Block a user