]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
detailpage: ask API for addressdetails, childplaces
authorMarc Tobias Metten <mtmail@gmx.net>
Thu, 8 Mar 2018 20:36:49 +0000 (21:36 +0100)
committerMarc Tobias Metten <mtmail@gmx.net>
Thu, 8 Mar 2018 20:36:49 +0000 (21:36 +0100)
TODO.md
src/assets/js/detailpage.js
src/templates/detailspage.hbs

diff --git a/TODO.md b/TODO.md
index c27300d8a4e7595ead7c7a691deb25672b1935c1..21073fb0427eb0de667ff54729ebb1a7703a1a48 100644 (file)
--- a/TODO.md
+++ b/TODO.md
 * reverse: zoom not set
 http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484374999999&zoom=
 * details page: add "There are more child objects which are not shown" back in
-* details page: nicer 404
 * move this TODO.txt to github issues
 * write install instructions
 * check output of /dist into repository
 
 ## Might never work
 
-* pagination
+* pagination. API returns an array whichout indication if more results exist
 * API returns category, type, but without admin_level we can't derive e.g. state,country
 * seeting acceptlanguage whichout a server component https://github.com/dansingerman/jQuery-Browser-Language
+* nice 404 detail page. The API returns HTTP 400 error instead of an empty data set.
 
 ## Unknown
 
@@ -44,6 +44,7 @@ http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484
 * don't copy jquery/leaflet in /src, use dependency manager instead, e.g. https://bower.io/
 * add tests with fixtures
 * concatenate/minify JS and CSS
+* detailpage: make linkedplaces, childplaces optional (rarely used? second click to enable?)
 
 
 ## Code cleanup
index 046667058ca877e90b39704f733b2047a1306fa1..9ab6cc820f22c3523829d08801244e47d78ab153 100644 (file)
@@ -56,6 +56,9 @@ jQuery(document).ready(function(){
         place_id: search_params.get('place_id'),
         osmtype: search_params.get('osmtype'),
         osmid: search_params.get('osmid'),
+        addressdetails: 1,
+        linkedplaces: 1,
+        childplaces: 1,
         group_parents: 1,
         format: 'json'
     };
index 5982ee98d5d97a4d02e3b5989663c3e9705c1b3a..172539c3469442a3cecc3336fa7aea9d9adc1246 100644 (file)
                     </tr>
                 </thead>
                 <tbody>
-                    {{#each aPlace.address_lines}}
-                        {{> partial_details_one_row}}
-                    {{/each}}
-
+                    {{#if aPlace.address_lines}}
+                        {{#each aPlace.address_lines}}
+                            {{> partial_details_one_row}}
+                        {{/each}}
+                    {{/if}}
 
                     {{#if aPlace.linked_lines}}
                         {{> partial_h2 'Linked Places'}}