diff --git a/src/services/api.js b/src/services/api.js index 8c91c17ac8..9ca62584e1 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -1,5 +1,6 @@ import { useCookies } from '@vueuse/integrations/useCookies' +const NOMINATIM_RESULT_TYPE_EXCLUDE_LIST = ['fuel', 'gas', 'casino'] const USERNAME_COOKIE_KEY = 'username' const TOKEN_COOKIE_KEY = 'access_token' const RECENT_LOCATIONS_LOCAL_STORAGE_KEY = 'recent_locations' @@ -126,10 +127,11 @@ export default { }, openstreetmapNominatimSearch(q) { - return fetch(`https://nominatim.openstreetmap.org/search?q=${q}&format=json&limit=5`, { + return fetch(`https://nominatim.openstreetmap.org/search?q=${q}&addressdetails=1&format=json&limit=10`, { method: 'GET', }) .then((response) => response.json()) + .then((data) => data.filter(l => !NOMINATIM_RESULT_TYPE_EXCLUDE_LIST.includes(l.type))) }, getRecentLocations(limit=null) {