X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/e9e54ec8046cf74d6d6f1c1ae04ca746aa3fefc2..33de9096af645f6783bf3f18e1b389d39e586e2b:/lib/PlaceLookup.php diff --git a/lib/PlaceLookup.php b/lib/PlaceLookup.php index 8a1a3666..a2f39ea3 100644 --- a/lib/PlaceLookup.php +++ b/lib/PlaceLookup.php @@ -448,16 +448,24 @@ class PlaceLookup } } - $aPlace['addresstype'] = ClassTypes\getProperty( + $aPlace['addresstype'] = ClassTypes\getLabelTag( $aPlace, - 'simplelabel', - $aPlace['class'] + $aPlace['country_code'] ); + + $aResults[$aPlace['place_id']] = $aPlace; } - Debug::printVar('Places', $aPlaces); + $aResults = array_filter( + $aResults, + function ($v) { + return !($v instanceof Result); + } + ); + + Debug::printVar('Places', $aResults); - return $aPlaces; + return $aResults; } /* returns an array which will contain the keys