From 29b0fde11c6f1e42ad68e2143880ccc4c31d3917 Mon Sep 17 00:00:00 2001 From: Jochen Klar Date: Thu, 28 Sep 2023 18:35:30 +0200 Subject: [PATCH] Keep zoom level while searching --- package-lock.json | 4 ++-- src/components/Map.vue | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 94a8c5a..df2eb90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@codeforberlin/maps.codefor.de", + "name": "@codeforberlin/maps.berlin.codefor.de", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@codeforberlin/maps.codefor.de", + "name": "@codeforberlin/maps.berlin.codefor.de", "version": "1.0.0", "dependencies": { "core-js": "^3.6.5", diff --git a/src/components/Map.vue b/src/components/Map.vue index 287bd85..f73a58c 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -33,6 +33,9 @@ }, changeView: function() { this.leafletMap.setView(this.center, this.zoom) + }, + changeCenter: function() { + this.leafletMap.panTo(this.center) } }, watch: { @@ -40,7 +43,7 @@ this.changeMap() }, center() { - this.changeView() + this.changeCenter() } }, mounted() {