ignore admin_level = 15 in geocodejson output

Level 15 is an artifical value.
This commit is contained in:
Sarah Hoffmann 2018-07-06 21:59:17 +02:00
parent 01d5ecb86b
commit 05bef92f0f

View File

@ -546,13 +546,15 @@ class PlaceLookup
{
$aAddressLines = $this->getAddressDetails(
$iPlaceID,
false,
true,
$sHousenumber === null ? -1 : $sHousenumber
);
$aAddress = array();
foreach ($aAddressLines as $aLine) {
if (isset($aLine['admin_level'])) {
if (isset($aLine['admin_level'])
&& $aLine['admin_level'] < 15
&& !isset($aAddress['level'.$aLine['admin_level']])) {
$aAddress['level'.$aLine['admin_level']] = $aLine['localname'];
}
}