make PlaceLookup::lookup() accept multiple results

This commit is contained in:
Sarah Hoffmann
2017-10-22 20:20:56 +02:00
parent 5eb11800a7
commit 914caab43d
2 changed files with 14 additions and 16 deletions

View File

@@ -59,7 +59,12 @@ if ($sOsmType && $iOsmId > 0) {
$oLookup = $oReverseGeocode->lookup($fLat, $fLon);
if (CONST_Debug) var_dump($oLookup);
$aPlace = $oPlaceLookup->lookup($oLookup);
if ($oLookup) {
$aPlaces = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup));
if (sizeof($aPlaces)) {
$aPlace = reset($aPlaces);
}
}
} elseif ($sOutputFormat != 'html') {
userError("Need coordinates or OSM object to lookup.");
}