diff --git a/src/components/LocationCard.vue b/src/components/LocationCard.vue index 8493bb2200..1eee455917 100644 --- a/src/components/LocationCard.vue +++ b/src/components/LocationCard.vue @@ -8,7 +8,7 @@ - {{ location.osm_tag_key }}:{{ location.osm_tag_value }} + {{ getLocationCategory(location) }} @@ -39,6 +39,9 @@ export default { } return this.$route.params.id }, + getLocationCategory(location) { + return utils.getLocationCategory(location) + }, goToLocation(location) { if (this.readonly) { return diff --git a/src/constants.js b/src/constants.js index 20833c7938..4f4ffcd7ee 100644 --- a/src/constants.js +++ b/src/constants.js @@ -66,5 +66,6 @@ export default { 'apartments', 'barracks', 'bungalow', 'cabin', 'detached', 'dormitory', 'ger', 'house', 'houseboat', 'residential', // 'farm', 'hotel' 'fuel', 'gas', 'casino', 'parking', 'parking_space', 'charging_station', 'atm', 'car_sharing', + 'yes', ], } diff --git a/src/services/api.js b/src/services/api.js index 5017807290..7b14c7b13e 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -223,7 +223,7 @@ export default { }) .then((response) => response.json()) .then(data => data.features) - .then((data) => data.filter(l => !constants.NOMINATIM_RESULT_TYPE_EXCLUDE_LIST.includes(l.properties.osm_key))) + .then((data) => data.filter(l => !constants.NOMINATIM_RESULT_TYPE_EXCLUDE_LIST.includes(l.properties.osm_value))) }, openstreetmapSearch(q, source='nominatim') { if (source === 'photon') { diff --git a/src/utils.js b/src/utils.js index 71edcb149e..c91a407288 100644 --- a/src/utils.js +++ b/src/utils.js @@ -193,13 +193,17 @@ function getLocationUniqueID(locationObject) { } function getLocationCategory(locationObject) { - // examples: shop, amenity, building + // examples: shop:supermarket, shop:convenience, shop:bakery, shop:doityourself // Photon if (locationObject.properties) { - return locationObject.properties.type + return `${locationObject.properties.osm_key}:${locationObject.properties.osm_value}` } - // Nominatim or OP - return locationObject.type || locationObject.osm_type + // Nominatim + else if (locationObject.address) { + return `${locationObject.class}:${locationObject.type}` + } + // OP + return `${locationObject.osm_tag_key}:${locationObject.osm_tag_value}` } function getLocationLatLng(locationObject) {