X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/f87ea067ca6023a01d0d3c5b0fb5f9b47790228b..a0e39b67d5d3ad52afbc3dd33ebc5c754ad9092a:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index 1959ded3..8a491818 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -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; + } +