Frontend: Always show marker on map, if query contains lat & long
This commit is contained in:
parent
89b1858f3b
commit
ec0559136b
|
@ -76,8 +76,6 @@
|
||||||
this.$viewer.show(this.results, index)
|
this.$viewer.show(this.results, index)
|
||||||
},
|
},
|
||||||
currentPositionSuccess(position) {
|
currentPositionSuccess(position) {
|
||||||
this.center = L.latLng(position.coords.latitude, position.coords.longitude);
|
|
||||||
this.position = L.latLng(position.coords.latitude, position.coords.longitude);
|
|
||||||
this.query.lat = position.coords.latitude;
|
this.query.lat = position.coords.latitude;
|
||||||
this.query.long = position.coords.longitude;
|
this.query.long = position.coords.longitude;
|
||||||
this.query.q = "";
|
this.query.q = "";
|
||||||
|
@ -174,7 +172,16 @@
|
||||||
this.$alert.info(photos.length + ' photos found');
|
this.$alert.info(photos.length + ' photos found');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updateQuery() {
|
||||||
|
this.$router.replace({query: this.query});
|
||||||
|
|
||||||
|
if(this.query.lat && this.query.long) {
|
||||||
|
this.position = L.latLng(this.query.lat, this.query.long);
|
||||||
|
this.center = L.latLng(this.query.lat, this.query.long);
|
||||||
|
} else {
|
||||||
|
this.position = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
search() {
|
search() {
|
||||||
// Don't query the same data more than once
|
// Don't query the same data more than once
|
||||||
if (JSON.stringify(this.lastQuery) === JSON.stringify(this.query)) return;
|
if (JSON.stringify(this.lastQuery) === JSON.stringify(this.query)) return;
|
||||||
|
@ -183,6 +190,8 @@
|
||||||
|
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
|
|
||||||
|
this.updateQuery();
|
||||||
|
|
||||||
this.$router.replace({query: this.query});
|
this.$router.replace({query: this.query});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user