]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / search.php
index f1ddbbe5d8f9f691cd9dfdb90768943843bb0c2f..e85c33697fa66554a7bb532aadf3ff3001cadedb 100755 (executable)
        $aLangPrefOrder = getPreferredLanguages();
        $oGeocode->setLanguagePreference($aLangPrefOrder);
 
        $aLangPrefOrder = getPreferredLanguages();
        $oGeocode->setLanguagePreference($aLangPrefOrder);
 
+    /*
+       if (isset($aLangPrefOrder['name:de'])) $oGeocode->setReverseInPlan(true);
+       if (isset($aLangPrefOrder['name:ru'])) $oGeocode->setReverseInPlan(true);
+       if (isset($aLangPrefOrder['name:ja'])) $oGeocode->setReverseInPlan(true);
+       if (isset($aLangPrefOrder['name:pl'])) $oGeocode->setReverseInPlan(true);
+    */
+
        function loadParamsToGeocode($oGeocode, $aParams, $bBatch = false)
        {
                if (isset($aParams['addressdetails'])) $oGeocode->setIncludeAddressDetails((bool)$aParams['addressdetails']);
        function loadParamsToGeocode($oGeocode, $aParams, $bBatch = false)
        {
                if (isset($aParams['addressdetails'])) $oGeocode->setIncludeAddressDetails((bool)$aParams['addressdetails']);
@@ -29,6 +36,8 @@
                if (isset($aParams['limit'])) $oGeocode->setLimit((int)$aParams['limit']);
                if (isset($aParams['offset'])) $oGeocode->setOffset((int)$aParams['offset']);
 
                if (isset($aParams['limit'])) $oGeocode->setLimit((int)$aParams['limit']);
                if (isset($aParams['offset'])) $oGeocode->setOffset((int)$aParams['offset']);
 
+               if (isset($aParams['fallback'])) $oGeocode->setFallback((int)$aParams['fallback']);
+
                // List of excluded Place IDs - used for more acurate pageing
                if (isset($aParams['exclude_place_ids']) && $aParams['exclude_place_ids'])
                {
                // List of excluded Place IDs - used for more acurate pageing
                if (isset($aParams['exclude_place_ids']) && $aParams['exclude_place_ids'])
                {
                if (!$sQuery)
                {
                        $oGeocode->setStructuredQuery(@$aParams['amenity'], @$aParams['street'], @$aParams['city'], @$aParams['county'], @$aParams['state'], @$aParams['country'], @$aParams['postalcode']);
                if (!$sQuery)
                {
                        $oGeocode->setStructuredQuery(@$aParams['amenity'], @$aParams['street'], @$aParams['city'], @$aParams['county'], @$aParams['state'], @$aParams['country'], @$aParams['postalcode']);
+                       $oGeocode->setReverseInPlan(false);
                }
                else
                {
                }
                else
                {
                        }
                        exit;
                }
                        }
                        exit;
                }
-               $oGeocode->setIncludePolygonAsText($bAsPoints);
+               $oGeocode->setIncludePolygonAsPoints($bAsPoints);
                $oGeocode->setIncludePolygonAsText($bAsText);
                $oGeocode->setIncludePolygonAsGeoJSON($bAsGeoJSON);
                $oGeocode->setIncludePolygonAsKML($bAsKML);
                $oGeocode->setIncludePolygonAsText($bAsText);
                $oGeocode->setIncludePolygonAsGeoJSON($bAsGeoJSON);
                $oGeocode->setIncludePolygonAsKML($bAsKML);
 
        loadParamsToGeocode($oGeocode, $_GET, false);
 
 
        loadParamsToGeocode($oGeocode, $_GET, false);
 
-       if (isset($_GET['batch']))
+       if (CONST_Search_BatchMode && isset($_GET['batch']))
        {
                $aBatch = json_decode($_GET['batch'], true);
                $aBatchResults = array();
        {
                $aBatch = json_decode($_GET['batch'], true);
                $aBatchResults = array();
        $bAsText = $oGeocode->getIncludePolygonAsText();
        $sQuery = $oGeocode->getQueryString();
        $sViewBox = $oGeocode->getViewBoxString();
        $bAsText = $oGeocode->getIncludePolygonAsText();
        $sQuery = $oGeocode->getQueryString();
        $sViewBox = $oGeocode->getViewBoxString();
-       $bShowPolygons = (isset($_GET['polygon']) && isset($_GET['polygon']));
+       $bShowPolygons = (isset($_GET['polygon']) && $_GET['polygon']);
        $aExcludePlaceIDs = $oGeocode->getExcludedPlaceIDs();
 
        $sMoreURL = CONST_Website_BaseURL.'search?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$oGeocode->getExcludedPlaceIDs());
        $aExcludePlaceIDs = $oGeocode->getExcludedPlaceIDs();
 
        $sMoreURL = CONST_Website_BaseURL.'search?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$oGeocode->getExcludedPlaceIDs());