From: marc tobias Date: Thu, 5 Apr 2018 13:47:52 +0000 (+0200) Subject: bring in line with API (https://github.com/openstreetmap/Nominatim/pull/968) X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/commitdiff_plain/538e9b96540c07059f725475c2b7fb80278c0dd6?ds=sidebyside bring in line with API (https://github.com/openstreetmap/Nominatim/pull/968) --- diff --git a/TODO.md b/TODO.md index 346e664..dc75782 100644 --- a/TODO.md +++ b/TODO.md @@ -43,7 +43,7 @@ http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484 * add tests with fixtures * concatenate/minify JS and CSS * detailpage: make linkedplaces, childplaces optional (rarely used? second click to enable?) - +* set better alt tag for icons ## Code cleanup diff --git a/src/assets/js/detailpage.js b/src/assets/js/detailpage.js index 906cd03..299103e 100644 --- a/src/assets/js/detailpage.js +++ b/src/assets/js/detailpage.js @@ -58,9 +58,8 @@ jQuery(document).ready(function(){ osmid: search_params.get('osmid'), keywords: search_params.get('keywords'), addressdetails: 1, - linkedplaces: 1, - childplaces: 1, - group_childplaces: 1, + hierarchy: 1, + group_hierarchy: 1, polygon_geojson: 1, format: 'json' }; diff --git a/src/handlebar_helpers.js b/src/handlebar_helpers.js index 722d4bb..8970578 100644 --- a/src/handlebar_helpers.js +++ b/src/handlebar_helpers.js @@ -17,14 +17,14 @@ Handlebars.registerHelper({ return ((aAddressLine.isaddress && aAddressLine.isaddress == 'f') ? 'notused' : ''); }, // { osm_type: 'R', osm_id: 12345 } - // relation 12345relation 12345' + sOSMType + ' ' + aPlace.osm_id + '' + '' + sOSMType + ' ' + aPlace.osm_id + '' ); }, /* en:London_Borough_of_Redbridge => https://en.wikipedia.org/wiki/London_Borough_of_Redbridge */ @@ -42,7 +42,7 @@ Handlebars.registerHelper({ ); }, // { osm_type: 'R', osm_id: 12345 } - // relation 12345details detailsLink: function(aFeature, sTitle) { if (!aFeature) return ''; if (!aFeature.place_id) return ''; @@ -80,7 +80,7 @@ Handlebars.registerHelper({ formatMapIcon: function(sIcon) { if (!sIcon) return; - var url = sIcon.match(/png$/) ? Nominatim_Config.Images_Base_Url + '/' + sIcon : Nominatim_Config.Images_Base_Url + 'nominatim/images/mapicons/' + sIcon + '.n.32.png'; + var url = Nominatim_Config.Images_Base_Url + sIcon; return new Handlebars.SafeString( '' + sIcon + '' @@ -100,11 +100,11 @@ Handlebars.registerHelper({ return capitalize(aPlace.type.replace(/_/g, ' ')); } }, - tooManyParentLinesWarning: function(aPlace) { - if (!aPlace.parentof) return; + tooManyHierarchyLinesWarning: function(aPlace) { + if (!aPlace.hierarchy) return; var c = 0; - for (var type in aPlace.parentof) { + for (var type in aPlace.hierarchy) { c = c + type.length+1; } if (c < 500) return; diff --git a/src/templates/detailspage.hbs b/src/templates/detailspage.hbs index 4ee9d46..a725cd5 100644 --- a/src/templates/detailspage.hbs +++ b/src/templates/detailspage.hbs @@ -100,7 +100,7 @@ {{/if}} Computed Postcode - {{aPlace.postcode}} + {{aPlace.calculated_postcode}} Address Tags @@ -165,17 +165,17 @@ {{/each}} {{/if}} - {{#if aPlace.parentof}} + {{#if aPlace.hierarchy}} {{> partial_h2 'Parent Of'}} - {{#each aPlace.parentof as |lines type|}} + {{#each aPlace.hierarchy as |lines type|}} {{> partial_h3 type}} {{#each lines}} {{> partial_details_one_row}} {{/each}} {{/each}} {{/if}} - {{tooManyParentLinesWarning aPlace}} + {{tooManyHierarchyLinesWarning aPlace}}