X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/64957170360f6d5bdf00c741de30b7df77f23bd3..e52ee350618d8cbbe2ab147bfb2cef6507d6e12e:/lib/template/search-json.php diff --git a/lib/template/search-json.php b/lib/template/search-json.php index 774b5be0..30817c04 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,7 +44,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['icon'] = $aPointDetails['icon']; } - if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])) { + if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) { $aPlace['address'] = $aPointDetails['address']; }