Frontend: Don't fit bounds when search is cleared
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
96d87ac6f7
commit
fc3a83e5cd
@ -39,6 +39,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
initialized: false,
|
||||||
map: null,
|
map: null,
|
||||||
markers: {},
|
markers: {},
|
||||||
markersOnScreen: {},
|
markersOnScreen: {},
|
||||||
@ -122,12 +123,16 @@
|
|||||||
|
|
||||||
this.map.getSource("photos").setData(this.result);
|
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();
|
this.updateMarkers();
|
||||||
} else {
|
} else {
|
||||||
this.$notify.warning("No photos found");
|
this.$notify.warning("No photos found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.initialized = true;
|
||||||
}).catch(() => this.loading = false);
|
}).catch(() => this.loading = false);
|
||||||
},
|
},
|
||||||
renderMap() {
|
renderMap() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user