X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/f51f2a70794858f9c8fb5d75ecd40fd1e4ec3897..bd736ef3e4a2554147cc49a55537052489ed7bfe:/src/lib/helpers.js diff --git a/src/lib/helpers.js b/src/lib/helpers.js index cbbdbc9..de1cfd4 100644 --- a/src/lib/helpers.js +++ b/src/lib/helpers.js @@ -41,8 +41,8 @@ function formatLabel(aPlace) { return s && s[0].toUpperCase() + s.slice(1); } - if (aPlace.type && aPlace.type === 'yes' && aPlace.class) { - return capitalize(aPlace.class.replace(/_/g, ' ')); + if (aPlace.type && aPlace.type === 'yes' && aPlace.category) { + return capitalize(aPlace.category.replace(/_/g, ' ')); } if (aPlace.type) { return capitalize(aPlace.type.replace(/_/g, ' ')); @@ -100,7 +100,7 @@ function formatPlaceType(aPlace) { // Any over 15 are invalid data in OSM anyway function formatAdminLevel(iLevel) { - return (iLevel < 15 ? iLevel : ''); + return (iLevel && iLevel < 15 ? iLevel : ''); } function formatDistance(fDistance, bInMeters) {