dev #160
@ -1,4 +1,14 @@
|
||||
|
||||
function drop_fields(results) {
|
||||
results.forEach(e => {
|
||||
delete e.licence;
|
||||
delete e.place_rank;
|
||||
delete e.importance;
|
||||
delete e.boundingbox;
|
||||
});
|
||||
return results
|
||||
}
|
||||
|
||||
export function nominatim_get_data(id: string, bb: string[][] | null = null): Promise<any> {
|
||||
if (!id) return Promise.resolve([])
|
||||
|
||||
@ -11,6 +21,6 @@ export function nominatim_get_data(id: string, bb: string[][] | null = null): Pr
|
||||
}
|
||||
return fetch(url).then((res) => {
|
||||
if (!res.ok) throw new Error("Nominatim Error")
|
||||
return res.json()
|
||||
return res.json().then(r => drop_fields(r))
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user