From: Sarah Hoffmann Date: Wed, 22 Aug 2018 20:38:32 +0000 (+0200) Subject: Merge pull request #1151 from mtmail/documentation-for-details-endpoint X-Git-Tag: v3.2.0~12 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/3502ff837ff1718083ba084ced332a9c66ac15a8?hp=4d38833170cef905f488cfebe8021cff10c7d3aa Merge pull request #1151 from mtmail/documentation-for-details-endpoint documentation for /details endpoint --- diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 4d5ccb87..01583e5f 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -46,8 +46,7 @@ function hash_to_subtable($aAssociatedList) { $sHTML = ''; - foreach($aAssociatedList as $sKey => $sValue) - { + foreach ($aAssociatedList as $sKey => $sValue) { $sHTML = $sHTML.'
'.$sValue.' ('.$sKey.')
'."\n"; } return $sHTML; @@ -162,13 +161,10 @@ - $aHierarchyLines) - { + foreach ($aGroupedAddressLines as $sGroupHeading => $aHierarchyLines) { $sGroupHeading = ucwords($sGroupHeading); headline3($sGroupHeading); - foreach($aHierarchyLines as $aAddressLine) - { + foreach ($aHierarchyLines as $aAddressLine) { _one_row($aAddressLine); } } @@ -249,7 +241,7 @@ 'lon' => $aPointDetails['lon'], 'lat' => $aPointDetails['lat'], ); - echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';'; + echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';'; ?> diff --git a/lib/template/details-json.php b/lib/template/details-json.php index 9b4237c7..06554aba 100644 --- a/lib/template/details-json.php +++ b/lib/template/details-json.php @@ -26,7 +26,9 @@ $aPlaceDetails['calculated_importance'] = (float) $aPointDetails['calculated_imp $aPlaceDetails['extratags'] = $aPointDetails['aExtraTags']; $aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia']; -$aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'; +if ($aPointDetails['icon']) { + $aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'; +} $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address']; $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search']; diff --git a/test/bdd/api/details/params.feature b/test/bdd/api/details/params.feature index a0b990eb..3c9286ed 100644 --- a/test/bdd/api/details/params.feature +++ b/test/bdd/api/details/params.feature @@ -41,3 +41,16 @@ Feature: Object details | linkedplaces | | 1 | Then the result is valid json + + Scenario Outline: HTML Details with keywords + When sending html details query for + | keywords | + | 1 | + Then the result is valid html + + Examples: + | osmid | + | W78099902 | + | N3121929846 | + +