X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9b76a8ffb4c4cd13628d85c00cf286382970b149..b1e5f3cbed17d862fda8f6a238aa1d69fe8786c0:/lib/template/search-json.php diff --git a/lib/template/search-json.php b/lib/template/search-json.php index 7c87f636..4b896d08 100644 --- a/lib/template/search-json.php +++ b/lib/template/search-json.php @@ -15,10 +15,6 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { if (isset($aPointDetails['aBoundingBox'])) { $aPlace['boundingbox'] = $aPointDetails['aBoundingBox']; - - if (isset($aPointDetails['aPolyPoints'])) { - $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints']; - } } if (isset($aPointDetails['zoom'])) { @@ -27,9 +23,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 +40,8 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['icon'] = $aPointDetails['icon']; } - if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) { - $aPlace['address'] = $aPointDetails['address']; + if (isset($aPointDetails['address'])) { + $aPlace['address'] = $aPointDetails['address']->getAddressNames(); } if (isset($aPointDetails['asgeojson'])) {