X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0d189ac5df8341e80a118bc8e67e126d03cd5302..1b62162e084698917627d941b0c32fb388e0f783:/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