Skip to content

Commit

Permalink
Keep zoom level while searching (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Sep 28, 2023
1 parent 184d782 commit e0d02b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@
},
changeView: function() {
this.leafletMap.setView(this.center, this.zoom)
},
changeCenter: function() {
this.leafletMap.panTo(this.center)
}
},
watch: {
map() {
this.changeMap()
},
center() {
this.changeView()
this.changeCenter()
}
},
mounted() {
Expand Down

0 comments on commit e0d02b8

Please sign in to comment.