make search with location bookmarkable (fix #482) using geohash

set a default radius when a location is set, so it does not trigger a worldwide search
reduce pressure on server and view with debonce
This commit is contained in:
setop
2021-03-05 16:19:42 +00:00
committed by Thomas Citharel
parent 5be8872edc
commit 13f33b8393
3 changed files with 115 additions and 21 deletions

View File

@@ -81,7 +81,7 @@ export default class AddressAutoComplete extends Vue {
isFetching = false;
queryText: string = (this.value && new Address(this.value).fullName) || "";
initialQueryText = "";
addressModalActive = false;
@@ -149,12 +149,21 @@ export default class AddressAutoComplete extends Vue {
}
}
get queryText(): string {
if (this.value) {
return new Address(this.value).fullName;
}
return this.initialQueryText;
}
set queryText(queryText: string) {
this.initialQueryText = queryText;
}
@Watch("value")
updateEditing(): void {
if (!this.value?.id) return;
this.selected = this.value;
const address = new Address(this.selected);
this.queryText = `${address.poiInfos.name} ${address.poiInfos.alternativeName}`;
}
updateSelected(option: IAddress): void {