X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/1df5c38175a3d15f8e595f49506b4dfb46e73d29..44f6dce2dcac82048e460bb1f2a8fec6fb58b539:/src/handlebar_helpers.js diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index e233eb9..de8778b 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -14,15 +14,15 @@ function formatOSMType(sType, bExcludeExternal) { } Handlebars.registerHelper({ + formatOSMType: function (sType, bExcludeExternal) { + return formatOSMType(sType, bExcludeExternal); + }, shortOSMType: function (sType) { if (sType === 'node') return 'N'; if (sType === 'way') return 'W'; if (sType === 'relation') return 'R'; return ''; }, - isaddresses_unused: function (aAddressLine) { - return ((aAddressLine.isaddress && aAddressLine.isaddress === 'f') ? 'notused' : ''); - }, // { osm_type: 'R', osm_id: 12345 } // relation 12345' + sTitleEscaped + '' ); }, + formatPlaceType: function (aPlace) { + var sOut = aPlace.class + ':' + aPlace.type; + if (aPlace.type && aPlace.type === 'administrative' && aPlace.place_type) { + sOut = sOut + ' (' + aPlace.place_type + ')'; + } + return new Handlebars.SafeString(sOut); + }, coverageType: function (aPlace) { return (aPlace.isarea ? 'Polygon' : 'Point'); }, @@ -127,7 +134,7 @@ Handlebars.registerHelper({ }, formatSearchRank: function (iRank) { // same as - // https://github.com/openstreetmap/Nominatim/blob/master/sql/functions.sql + // https://github.com/osm-search/Nominatim/blob/master/sql/functions.sql // get_searchrank_label() if (iRank < 2) return 'continent';