X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/64957170360f6d5bdf00c741de30b7df77f23bd3..ae2ad38040f8515caa79bf274ddc345c6efeb6ef:/lib/template/search-json.php diff --git a/lib/template/search-json.php b/lib/template/search-json.php index 774b5be0..6108aca4 100644 --- a/lib/template/search-json.php +++ b/lib/template/search-json.php @@ -27,9 +27,10 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['lat'] = $aPointDetails['lat']; $aPlace['lon'] = $aPointDetails['lon']; + $aPlace['display_name'] = $aPointDetails['name']; - if ($sOutputFormat == 'jsonv2') { + if ($sOutputFormat == 'jsonv2' || $sOutputFormat == 'geojson') { $aPlace['place_rank'] = $aPointDetails['rank_search']; $aPlace['category'] = $aPointDetails['class']; } else { @@ -43,8 +44,8 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['icon'] = $aPointDetails['icon']; } - if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])) { - $aPlace['address'] = $aPointDetails['address']; + if (isset($aPointDetails['address'])) { + $aPlace['address'] = $aPointDetails['address']->getAddressNames(); } if (isset($aPointDetails['asgeojson'])) {