X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/665de339e5c1afde21d836ce4be9abe94ae483e0..a766240c063ea516c4f17497e4093d3d4758b7ff:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index a01abbc5..2d246d98 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1,5 +1,6 @@ aNearPoint[0], (float)$this->aNearPoint[1]); - if ($iPlaceID) - $aSearchResults = $this->getDetails(array($iPlaceID)); + $oReverse = new ReverseGeocode($this->oDB); + $oReverse->setLatLon((float)$this->aNearPoint[0], (float)$this->aNearPoint[1]); + $oReverse->setZoom(18); + + $aLookup = $oReverse->lookup(false); + + if (CONST_Debug) var_dump("Reverse search", $aLookup); + + if ($aLookup['place_id']) + $aSearchResults = $this->getDetails(array($aLookup['place_id'] => -1)); else $aSearchResults = array(); }