fix: Reinzoomen, Rauszoom und CenterHere in Contextmenu

This commit is contained in:
ISA
2024-07-15 11:38:13 +02:00
parent 29eb3e8192
commit 5b41072c46
3 changed files with 81 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
// utils/zoomAndCenterUtils.js
export const zoomIn = (e, map) => {
if (!map) {
console.error("map is not defined in zoomIn");
@@ -16,6 +17,8 @@ export const zoomOut = (map) => {
const x = 51.41321407879154;
const y = 7.739617925303934;
const zoom = 7;
console.log("map");
console.log(map);
map.flyTo([x, y], zoom);
localStorage.setItem("mapZoom", map.getZoom());
localStorage.setItem("mapCenter", JSON.stringify(map.getCenter()));