From d63845ed9abe36608e9ca34940b5e773ce7fa1bb Mon Sep 17 00:00:00 2001 From: sora-ext Date: Tue, 25 Feb 2025 18:02:57 +0100 Subject: [PATCH] Update src/server/api_nominatim.ts --- src/server/api_nominatim.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/api_nominatim.ts b/src/server/api_nominatim.ts index f264130..58a48f6 100644 --- a/src/server/api_nominatim.ts +++ b/src/server/api_nominatim.ts @@ -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 { 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)) }) }