Add onLocationChange.fitView config option

It defaults to false now, which is a change - this seems like a sensible
choice though. I can see how it would be annoying to have the map change
while looking at it just because *something* moved.

Fixes #41.
This commit is contained in:
Linus Groh
2020-09-07 21:30:47 +01:00
parent d7266f48f1
commit 206eb268fa
3 changed files with 14 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ const DEFAULT_CONFIG = {
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
},
onLocationChange: {
fitView: false,
reloadHistory: false,
},
primaryColor: "#3f51b5",

View File

@@ -232,7 +232,9 @@ export default {
},
watch: {
lastLocations() {
this.fitView();
if (this.$config.onLocationChange.fitView) {
this.fitView();
}
},
filteredLocationHistory() {
this.fitView();