use Result class in reverse geocoding

Also simplifies the reverse algorithm slightly by no longer
having an additional distance lookup.
This commit is contained in:
Sarah Hoffmann
2017-10-20 15:41:26 +02:00
parent 42f079c355
commit 1424e8e29b
5 changed files with 131 additions and 127 deletions

View File

@@ -1197,12 +1197,12 @@ class Geocode
$oReverse = new ReverseGeocode($this->oDB);
$oReverse->setZoom(18);
$aLookup = $oReverse->lookupPoint($oCtx->sqlNear, false);
$oLookup = $oReverse->lookupPoint($oCtx->sqlNear, false);
if (CONST_Debug) var_dump("Reverse search", $aLookup);
if ($aLookup['place_id']) {
$aResults = array($aLookup['place_id'] => new Result($aLookup['place_id']));
if ($oLookup) {
$aResults = array($oLookup->iId => $oLookup);
$aSearchResults = $this->getDetails($aResults, $oCtx);
} else {
$aSearchResults = array();