]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
don't include linked_place_id places in the sql output (causes errors on paging ...
[nominatim.git] / lib / lib.php
index cc8a90e0ae134350ec3039addb4adab1b379a0d7..8a4918182c55ec4d36d0bec999c7e9d8e36321bc 100644 (file)
@@ -94,7 +94,7 @@
                return ($a['foundorder'] < $b['foundorder']?-1:1);
        }
 
                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'])
        {
                // If we have been provided the value in $_GET it overrides browser value
                if (isset($_GET['accept-language']) && $_GET['accept-language'])
                return false;
 
                /*
                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));
                */
                        $iZoom = 18 + round(log($fTotalFac,32));
                        $iZoom = max(13,min(18,$iZoom));
                */
     {
         header("Access-Control-Allow-Origin: *");
 
     {
         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");
 
                if( ! isset($_GET['json_callback'])) {
                        header("Content-Type: application/json; charset=UTF-8");
 
                return $iPlaceID;
        }
 
                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;
+        }
+