No longer need to pass bounding box to nearby candidates API

This commit is contained in:
Edward Betts 2021-07-22 14:51:24 +02:00
parent 867e77ab7b
commit 08de45c42e

View file

@ -431,7 +431,7 @@
<a :href="`${api_base_url}/api/1/isa?${bounds_param()}`" target="_blank">item type counts</a> | <a :href="`${api_base_url}/api/1/isa?${bounds_param()}`" target="_blank">item type counts</a> |
<a :href="`${api_base_url}/api/1/item/${wd_item.qid}`" target="_blank">item detail</a> | <a :href="`${api_base_url}/api/1/item/${wd_item.qid}`" target="_blank">item detail</a> |
<a :href="`${api_base_url}/api/1/item/${wd_item.qid}/tags`" target="_blank">item tags</a> | <a :href="`${api_base_url}/api/1/item/${wd_item.qid}/tags`" target="_blank">item tags</a> |
<a :href="`${api_base_url}/api/1/item/${wd_item.qid}/candidates?${pad_bounds_param()}`" target="_blank">nearby OSM candidates</a> <a :href="`${api_base_url}/api/1/item/${wd_item.qid}/candidates`" target="_blank">nearby OSM candidates</a>
</div> </div>
<div v-if="!current_item.nearby" class="alert alert-info"> <div v-if="!current_item.nearby" class="alert alert-info">
@ -663,7 +663,6 @@ export default {
mode: undefined, mode: undefined,
current_hit: undefined, current_hit: undefined,
recent_search: undefined, recent_search: undefined,
pad_amount: 1.0,
}; };
}, },
computed: { computed: {
@ -846,9 +845,6 @@ export default {
bounds_param() { bounds_param() {
return 'bounds=' + this.map.getBounds().toBBoxString(); return 'bounds=' + this.map.getBounds().toBBoxString();
}, },
pad_bounds_param() {
return 'bounds=' + this.map.getBounds().pad(this.pad_amount).toBBoxString();
},
close_edit_list() { close_edit_list() {
this.view_edits = false; this.view_edits = false;
if (this.upload_state != 'done') return; if (this.upload_state != 'done') return;
@ -1137,10 +1133,8 @@ export default {
}); });
var item_osm_candidates_url = `${this.api_base_url}/api/1/item/${qid}/candidates`; var item_osm_candidates_url = `${this.api_base_url}/api/1/item/${qid}/candidates`;
var bounds = this.map.getBounds().pad(this.pad_amount);
var params = { bounds: bounds.toBBoxString() };
axios.get(item_osm_candidates_url, { params: params }).then((response) => { axios.get(item_osm_candidates_url).then((response) => {
var qid = response.data.qid; var qid = response.data.qid;
var item = this.items[qid]; var item = this.items[qid];
var osm_identifiers = item.osm ? Object.keys(item.osm) : []; var osm_identifiers = item.osm ? Object.keys(item.osm) : [];