X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1cb55c6e318cb86cd1d44463eff4b951496134c0..f67b1c20e1fed7434e8f425a0cb26d285e41ccda:/lib/lib.php?ds=sidebyside diff --git a/lib/lib.php b/lib/lib.php index cc8a90e0..8a491818 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -94,7 +94,7 @@ return ($a['foundorder'] < $b['foundorder']?-1:1); } - function getPrefferedLangauges() + function getPreferredLanguages() { // If we have been provided the value in $_GET it overrides browser value if (isset($_GET['accept-language']) && $_GET['accept-language']) @@ -273,7 +273,7 @@ return false; /* - $fTotalFac is a suprisingly good indicator of accuracy + $fTotalFac is a surprisingly good indicator of accuracy $iZoom = 18 + round(log($fTotalFac,32)); $iZoom = max(13,min(18,$iZoom)); */ @@ -597,7 +597,7 @@ { header("Access-Control-Allow-Origin: *"); - $jsonout = json_encode($xVal, JSON_UNESCAPED_UNICODE); + $jsonout = json_encode($xVal); if( ! isset($_GET['json_callback'])) { header("Content-Type: application/json; charset=UTF-8"); @@ -890,3 +890,17 @@ return $iPlaceID; } + + function loadStructuredAddressElement(&$aStructuredQuery, &$iMinAddressRank, &$iMaxAddressRank, $aParams, $sKey, $iNewMinAddressRank, $iNewMaxAddressRank) + { + if (!isset($_GET[$sKey])) return false; + $sValue = trim($_GET[$sKey]); + if (!$sValue) return false; + $aStructuredQuery[$sKey] = $sValue; + if ($iMinAddressRank == 0 && $iMaxAddressRank == 30) { + $iMinAddressRank = $iNewMinAddressRank; + $iMaxAddressRank = $iNewMaxAddressRank; + } + return true; + } +