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