Frontend: Don't fit bounds when search is cleared

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-01-15 04:49:49 +01:00
parent 96d87ac6f7
commit fc3a83e5cd

View File

@ -39,6 +39,7 @@
},
data() {
return {
initialized: false,
map: null,
markers: {},
markersOnScreen: {},
@ -122,12 +123,16 @@
this.map.getSource("photos").setData(this.result);
this.map.fitBounds(this.result.bbox, {maxZoom: 19});
if(this.filter.q || !this.initialized) {
this.map.fitBounds(this.result.bbox, {maxZoom: 19});
}
this.updateMarkers();
} else {
this.$notify.warning("No photos found");
}
this.initialized = true;
}).catch(() => this.loading = false);
},
renderMap() {