]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove now unused settings related to website
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 27 Oct 2020 20:29:35 +0000 (21:29 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 29 Oct 2020 10:13:32 +0000 (11:13 +0100)
There are two places where the website URL is still used:
for icons, replace the URL with a link to the icon repository
of the UI repo. The more URL now builds the link from the
server info.

lib/ClassTypes.php
lib/setup/SetupClass.php
settings/defaults.php
website/search.php

index 752db86598d7ddc1aed422e7679b98736b4e1ca3..bb7b0486cb628c687c342faa9faea86a8032ad5c 100644 (file)
@@ -252,13 +252,17 @@ function getIcon($aPlace)
  */
 function getIconFile($aPlace)
 {
+    if (CONST_MapIcon_URL === false) {
+        return null;
+    }
+
     $sIcon = getIcon($aPlace);
 
     if (!isset($sIcon)) {
         return null;
     }
 
-    return CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
+    return CONST_MapIcon_URL.'/'.$sIcon.'.p.20.png';
 }
 
 /**
index 2815f8c4b11a120bad4746776a7b6006ffc392db..7a4ef533e36f03191fcafe526eeca3e5207be392 100755 (executable)
@@ -713,13 +713,8 @@ class SetupFunctions
 @define('CONST_BasePath', '".CONST_BasePath."');
 if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
 
-@define('CONST_Database_DSN', '".CONST_Database_DSN."'); // or add ;host=...;port=...;user=...;password=...
+@define('CONST_Database_DSN', '".CONST_Database_DSN."');
 @define('CONST_Default_Language', ".(CONST_Default_Language ? ("'".CONST_Default_Language."'") : 'false').");
-@define('CONST_Default_Lat', ".CONST_Default_Lat.");
-@define('CONST_Default_Lon', ".CONST_Default_Lon.");
-@define('CONST_Default_Zoom', ".CONST_Default_Zoom.");
-@define('CONST_Map_Tile_URL', '".CONST_Map_Tile_URL."');
-@define('CONST_Map_Tile_Attribution', '".CONST_Map_Tile_Attribution."'); // Set if tile source isn't osm.org
 @define('CONST_Log_DB', ".(CONST_Log_DB ? 'true' : 'false').");
 @define('CONST_Log_File', ".(CONST_Log_File ? ("'".CONST_Log_File."'")  : 'false').");
 @define('CONST_Max_Word_Frequency', '".CONST_Max_Word_Frequency."');
@@ -733,7 +728,7 @@ if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SE
 @define('CONST_Term_Normalization_Rules', \"".CONST_Term_Normalization_Rules."\");
 @define('CONST_Use_Aux_Location_data', ".(CONST_Use_Aux_Location_data ? 'true' : 'false').");
 @define('CONST_Use_US_Tiger_Data', ".(CONST_Use_US_Tiger_Data ? 'true' : 'false').");
-@define('CONST_Website_BaseURL', '".CONST_Website_BaseURL."');
+@define('CONST_MapIcon_URL', ".(CONST_MapIcon_URL ? ("'".CONST_MapIcon_URL."'") : 'false').");
 ");
         info(CONST_InstallPath.'/settings/settings-frontend.php has been set up successfully');
     }
index 02b11237f34c4b3d9353a18e07b74c8f88533ce8..2ecbb5141fc9911d69367f3577dfe713e44919c5 100644 (file)
@@ -82,20 +82,16 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
 // How long to sleep when no update could be found
 @define('CONST_Replication_Recheck_Interval', '60');
 
-// Website settings
+// If true, send CORS headers to allow access
 @define('CONST_NoAccessControl', true);
 
-@define('CONST_Website_BaseURL', '/');
+// Set this to the /mapicon directory of your nominatim-ui to enable returning
+// icon URLs with the results.
+@define('CONST_MapIcon_URL', false);
 // Language to assume when none is supplied with the query.
 // When set to false, the local language (i.e. the name tag without suffix)
 // will be used.
 @define('CONST_Default_Language', false);
-// Appearance of the map in the debug interface.
-@define('CONST_Default_Lat', 20.0);
-@define('CONST_Default_Lon', 0.0);
-@define('CONST_Default_Zoom', 2);
-@define('CONST_Map_Tile_URL', 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png');
-@define('CONST_Map_Tile_Attribution', ''); // Set if tile source isn't osm.org
 
 @define('CONST_Search_AreaPolygons', true);
 
@@ -103,7 +99,7 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
 
 @define('CONST_Search_NameOnlySearchFrequencyThreshold', 500);
 // If set to true, then reverse order of queries will be tried by default.
-// When set to false only selected languages alloow reverse search.
+// When set to false only selected languages allow reverse search.
 @define('CONST_Search_ReversePlanForAll', true);
 
 // Maximum number of OSM ids that may be queried at once
index d2a1cc67f4ad563daadef15060be6b2d7f707c56..43c9fd010ac8389c3f67f8143de1545399bef667 100644 (file)
@@ -74,7 +74,17 @@ $aMoreParams['format'] = $sOutputFormat;
 if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
     $aMoreParams['accept-language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
 }
-$sMoreURL = CONST_Website_BaseURL.'search.php?'.http_build_query($aMoreParams);
+
+if (isset($_SERVER['REQUEST_SCHEME'])
+    && isset($_SERVER['SERVER_NAME'])
+    && isset($_SERVER['DOCUMENT_URI'])
+) {
+    $sMoreURL = $_SERVER['REQUEST_SCHEME'].'://'
+                .$_SERVER['SERVER_NAME'].$_SERVER['DOCUMENT_URI'].'/?'
+                .http_build_query($aMoreParams);
+} else {
+    $sMoreURL = '/search.php'.http_build_query($aMoreParams);
+}
 
 if (CONST_Debug) exit;