]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 8 Feb 2016 19:42:19 +0000 (20:42 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 8 Feb 2016 19:42:19 +0000 (20:42 +0100)
12 files changed:
lib/template/address-html.php
lib/template/details-html.php
lib/template/includes/introduction.php
lib/template/search-html.php
m4/ax_lib_xml2.m4 [new file with mode: 0644]
settings/settings.php
vagrant-provision.sh
website/css/details.css
website/details.php
website/js/nominatim-ui.js
website/reverse.php
website/search.php

index dbe982f0eed1e56a5362c0de5a77d5846942c3ee..f8d425e20808f93e2e10d789f42fe9507eb4aa08 100644 (file)
   <?php
 
     $aNominatimMapInit = [
-      'zoom' => isset($_GET['zoom'])?htmlspecialchars($_GET['zoom']):NULL,
-      'lat'  => isset($_GET['lat'] )?htmlspecialchars($_GET['lat']):NULL,
-      'lon'  => isset($_GET['lon'] )?htmlspecialchars($_GET['lon']):NULL
+      'zoom' => isset($_GET['zoom']) ? htmlspecialchars($_GET['zoom']) : CONST_Default_Zoom,
+      'lat'  => isset($_GET['lat'] ) ? htmlspecialchars($_GET['lat'] ) : CONST_Default_Lat,
+      'lon'  => isset($_GET['lon'] ) ? htmlspecialchars($_GET['lon'] ) : CONST_Default_Lon,
+      'tile_url' => $sTileURL,
+      'tile_attribution' => $sTileAttribution
     ];
     echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
 
index 548cee7a6bf03def144ffed669f1cc388ea4babf..6845cbb22821df791093d0ce3b5d4a187faa2ec5 100644 (file)
@@ -6,14 +6,18 @@
        <link href="css/details.css" rel="stylesheet" type="text/css" />
 </head>
 
-<?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
 
 
 <?php
 
        function headline($sTitle)
        {
-               echo "<h2>".$sTitle."</h2>\n";
+               echo "<tr class='all-columns'><td colspan='6'><h2>".$sTitle."</h2></td></tr>\n";
+       }
+
+       function headline3($sTitle)
+       {
+               echo "<tr class='all-columns'><td colspan='6'><h3>".$sTitle."</h3></td></tr>\n";
        }
 
        function osm_link($aFeature)
        function _one_row($aAddressLine){
                $bNotUsed = (isset($aAddressLine['isaddress']) && $aAddressLine['isaddress'] == 'f');
 
-               echo '<tr class="' . ($bNotUsed?'notused':'') . '">';
-               echo '  <td class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</td>';
-               echo '  <td>' . $aAddressLine['class'].':'.$aAddressLine['type'] . '</td>';
-               echo '  <td>' . osm_link($aAddressLine) . '</td>';
-               echo '  <td>' . (isset($aAddressLine['admin_level']) ? $aAddressLine['admin_level'] : '') . '</td>';
-               // echo '<td>' . (isset($aAddressLine['rank_search_label']) ? $aAddressLine['rank_search_label'] : '') .'</td>';
+               echo '<tr class="' . ($bNotUsed?'notused':'') . '">'."\n";
+               echo '  <td class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>')."</td>\n";
+               echo '  <td>' . $aAddressLine['class'].':'.$aAddressLine['type'] . "</td>\n";
+               echo '  <td>' . osm_link($aAddressLine) . "</td>\n";
+               echo '  <td>' . (isset($aAddressLine['admin_level']) ? $aAddressLine['admin_level'] : '') . "</td>\n";
+               // echo '<td>' . (isset($aAddressLine['rank_search_label']) ? $aAddressLine['rank_search_label'] : '') ."</td>\n";
                // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
-               echo '  <td>' . format_distance($aAddressLine['distance']).'</td>';;
-               echo '  <td>' . nominatim_link($aAddressLine,'details &gt;') . '</td>';;
+               echo '  <td>' . format_distance($aAddressLine['distance'])."</td>\n";
+               echo '  <td>' . nominatim_link($aAddressLine,'details &gt;') . "</td>\n";
                echo "</tr>\n";
        }
 
 
 
 <body id="details-page">
+       <?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
        <div class="container">
                <div class="row">
                        <div class="col-sm-10">
                                        }
                                ?>
        
-                               </tbody>
-                       </table>
 
 
 <?php
        if ($aLinkedLines)
        {
                headline('Linked Places');
-               echo '<table id="linked" class="table table-striped table-responsive">';
                foreach($aLinkedLines as $aAddressLine)
                {       
                        _one_row($aAddressLine);
                }
-               echo '</table>';
        }
 
 
                        echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'."</div>\n";
                }
        }
-
+       
        if (sizeof($aParentOfLines))
        {
                headline('Parent Of');
                foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
                {
                        $sGroupHeading = ucwords($sGroupHeading);
-                       echo "<h3>$sGroupHeading</h3>\n";
+                       headline3($sGroupHeading);
 
-                       echo '<table id="linked" class="table table-striped table-responsive">';
                        foreach($aParentOfLines as $aAddressLine)
                        {
                                _one_row($aAddressLine);
                        }
-                       echo '</table>';
                }
                if (sizeof($aParentOfLines) >= 500) {
                        echo '<p>There are more child objects which are not shown.</p>';
 
        // headline('Other Parts');
        // headline('Linked To');
+
+       echo "</table>\n";
 ?>
 
                        </div>
        </div>
 
        <script type="text/javascript">
+       <?php
+
+    $aNominatimMapInit = [
+      'tile_url' => $sTileURL,
+      'tile_attribution' => $sTileAttribution
+    ];
+    echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
+
+    $aPlace = [
+                       'outlinestring' => $aPointDetails['outlinestring'],
+                       'lon' => $aPointDetails['lon'],
+                       'lat' => $aPointDetails['lat'],
+    ];
+         echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';'; 
 
-               var nominatim_result = {
-                       outlinestring: '<?php echo $aPointDetails['outlinestring'];?>',
-                       lon: <?php echo $aPointDetails['lon'];?>,
-                       lat: <?php echo $aPointDetails['lat'];?>,
-               };
 
+  ?>
        </script>
 
 
index 6d627469aa2fd27c3f6bde02be4ed4ce0d9fecee..8ff057deffa379801df9c6fef2c06b2ace3d4ad3 100644 (file)
@@ -1,7 +1,9 @@
 <h2>Welcome to Nominatim</h2>
 
 <p>Nominatim is a search engine for <a href="http://www.openstreetmap.org">OpenStreetMap</a>
-data. This is the debugging interface. You can try search and reverse search queries
-and explore the details of each object saved in the database.</p>
+data. This is the debugging interface. You may search for a name or address(forward search) or
+look up data by its geographic coordinate(reverse search). Each result comes with a
+link to a details page where you can inspect what data about the object is saved in 
+the database and investigate how the address of the object has been computed.</p>
 
 For more information visit the <a href="http://wiki.openstreetmap.org/wiki/Nominatim">Nominatim wiki page</a>.
index e523c44680e9b268db9c1e39ee88ecfc87b1c5b2..8b995b626faa70832b2bd4a2848a38866408e03c 100644 (file)
@@ -99,7 +99,9 @@
                $aNominatimMapInit = [
                        'zoom' => $iZoom,
                        'lat' => $fLat,
-                       'lon' => $fLon
+                       'lon' => $fLon,
+                       'tile_url' => $sTileURL,
+                       'tile_attribution' => $sTileAttribution
                ];
                echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
 
diff --git a/m4/ax_lib_xml2.m4 b/m4/ax_lib_xml2.m4
new file mode 100644 (file)
index 0000000..d0cd2cb
--- /dev/null
@@ -0,0 +1,150 @@
+# SYNOPSIS
+#
+#   AX_LIB_XML2([MINIMUM-VERSION])
+#
+# DESCRIPTION
+#
+#   This macro provides tests of availability of xml2 'libxml2' library
+#   of particular version or newer.
+#
+#   AX_LIB_LIBXML2 macro takes only one argument which is optional. If
+#   there is no required version passed, then macro does not run version
+#   test.
+#
+#   The --with-libxml2 option takes one of three possible values:
+#
+#   no - do not check for xml2 library
+#
+#   yes - do check for xml2 library in standard locations (xml2-config
+#   should be in the PATH)
+#
+#   path - complete path to xml2-config utility, use this option if xml2-config
+#   can't be found in the PATH
+#
+#   This macro calls:
+#
+#     AC_SUBST(XML2_CFLAGS)
+#     AC_SUBST(XML2_LDFLAGS)
+#     AC_SUBST(XML2_VERSION)
+#
+#   And sets:
+#
+#     HAVE_XML2
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Hartmut Holzgraefe <hartmut@php.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+AC_DEFUN([AX_LIB_XML2],
+[
+    AC_ARG_WITH([libxml2],
+        AC_HELP_STRING([--with-libxml2=@<:@ARG@:>@],
+            [use libxml2 library @<:@default=yes@:>@, optionally specify path to xml2-config]
+        ),
+        [
+        if test "$withval" = "no"; then
+            want_libxml2="no"
+        elif test "$withval" = "yes"; then
+            want_libxml2="yes"
+        else
+            want_libxml2="yes"
+            XML2_CONFIG="$withval"
+        fi
+        ],
+        [want_libxml2="yes"]
+    )
+
+    XML2_CFLAGS=""
+    XML2_LDFLAGS=""
+    XML2_VERSION=""
+
+    dnl
+    dnl Check xml2 libraries (libxml2)
+    dnl
+
+    if test "$want_libxml2" = "yes"; then
+
+        if test -z "$XML2_CONFIG" -o test; then
+            AC_PATH_PROG([XML2_CONFIG], [xml2-config], [])
+        fi
+
+        if test ! -x "$XML2_CONFIG"; then
+            AC_MSG_ERROR([$XML2_CONFIG does not exist or it is not an exectuable file])
+            XML2_CONFIG="no"
+            found_libxml2="no"
+        fi
+
+        if test "$XML2_CONFIG" != "no"; then
+            AC_MSG_CHECKING([for xml2 libraries])
+
+            XML2_CFLAGS="`$XML2_CONFIG --cflags`"
+            XML2_LDFLAGS="`$XML2_CONFIG --libs`"
+
+            XML2_VERSION=`$XML2_CONFIG --version`
+
+            AC_DEFINE([HAVE_XML2], [1],
+                [Define to 1 if xml2 libraries are available])
+
+            found_libxml2="yes"
+            AC_MSG_RESULT([yes])
+        else
+            found_libxml2="no"
+            AC_MSG_RESULT([no])
+        fi
+    fi
+
+    dnl
+    dnl Check if required version of xml2 is available
+    dnl
+
+
+    libxml2_version_req=ifelse([$1], [], [], [$1])
+
+
+    if test "$found_libxml2" = "yes" -a -n "$libxml2_version_req"; then
+
+        AC_MSG_CHECKING([if libxml2 version is >= $libxml2_version_req])
+
+        dnl Decompose required version string of libxml2
+        dnl and calculate its number representation
+        libxml2_version_req_major=`expr $libxml2_version_req : '\([[0-9]]*\)'`
+        libxml2_version_req_minor=`expr $libxml2_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
+        libxml2_version_req_micro=`expr $libxml2_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+        if test "x$libxml2_version_req_micro" = "x"; then
+            libxml2_version_req_micro="0"
+        fi
+
+        libxml2_version_req_number=`expr $libxml2_version_req_major \* 1000000 \
+                                   \+ $libxml2_version_req_minor \* 1000 \
+                                   \+ $libxml2_version_req_micro`
+
+        dnl Decompose version string of installed PostgreSQL
+        dnl and calculate its number representation
+        libxml2_version_major=`expr $XML2_VERSION : '\([[0-9]]*\)'`
+        libxml2_version_minor=`expr $XML2_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
+        libxml2_version_micro=`expr $XML2_VERSION : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+        if test "x$libxml2_version_micro" = "x"; then
+            libxml2_version_micro="0"
+        fi
+
+        libxml2_version_number=`expr $libxml2_version_major \* 1000000 \
+                                   \+ $libxml2_version_minor \* 1000 \
+                                   \+ $libxml2_version_micro`
+
+        libxml2_version_check=`expr $libxml2_version_number \>\= $libxml2_version_req_number`
+        if test "$libxml2_version_check" = "1"; then
+            AC_MSG_RESULT([yes])
+        else
+            AC_MSG_RESULT([no])
+        fi
+    fi
+
+    AC_SUBST([XML2_VERSION])
+    AC_SUBST([XML2_CFLAGS])
+    AC_SUBST([XML2_LDFLAGS])
+])
+
index 3deda462fc5f94e61a8e360a0219e40cebeefa2a..765849e74a7052ad7fa6e22d41b067df6d0d3e6e 100644 (file)
@@ -93,6 +93,8 @@
        @define('CONST_Default_Lat', 20.0);
        @define('CONST_Default_Lon', 0.0);
        @define('CONST_Default_Zoom', 2);
+       @define('CONST_Map_Tile_URL', 'http://{s}.tile.osm.org/{z}/{x}/{y}.png');
+       @define('CONST_Map_Tile_Attribution', ''); // Set if tile source isn't osm.org
 
        @define('CONST_Search_AreaPolygons_Enabled', true);
        @define('CONST_Search_AreaPolygons', true);
        @define('CONST_Log_File_Format', 'TODO'); // Currently hard coded
        @define('CONST_Log_File_SearchLog', '');
        @define('CONST_Log_File_ReverseLog', '');
+
+
index 3fae5b68b87ad02b2f15d77c9c866ec289852189..1a7702263ea4bb5a9cc32b59e26b3dd5aee5db6f 100755 (executable)
@@ -29,7 +29,7 @@ USERNAME=vagrant
 
 sudo apt-get update -qq
 sudo apt-get upgrade -y
-sudo apt-get install -y build-essential libxml2-dev libgeos-dev libpq-dev libbz2-dev \
+sudo apt-get install -y build-essential libgeos-dev libpq-dev libbz2-dev \
                         libtool automake libproj-dev libboost-dev  libboost-system-dev \
                         libboost-filesystem-dev libboost-thread-dev libexpat-dev
 sudo apt-get autoremove -y
@@ -73,18 +73,19 @@ echo "date.timezone = 'Etc/UTC'" | sudo tee /etc/php5/cli/conf.d/99-timezone.ini
 ###
 ### Nominatim
 ###
-sudo apt-get install -y libprotobuf-c0-dev protobuf-c-compiler \
-                        libgeos-c1 libgeos++-dev \
-                        lua5.2 liblua5.2-dev
-
-# git clone --recursive https://github.com/twain47/Nominatim.git
-
+sudo apt-get install -y libgeos-c1 libgeos++-dev libxml2-dev
 
 # now ideally login as $USERNAME and continue
 su $USERNAME -l
-cd /home/vagrant/Nominatim
+cd /home/vagrant
+
+if [ ! -d "Nominatim" ]; then
+  sudo apt-get install -y git
+  git clone --recursive https://github.com/twain47/Nominatim.git
+fi
+
+cd Nominatim
 
-# cd ~/Nominatim
 ./autogen.sh
 ./configure
 make
index 3eca1667198ab1dc3753dd8faecc4cdd8812cbe6..f1234295f4d44378e6dfb8958531d9859d53a1db 100644 (file)
@@ -5,11 +5,22 @@ h1 {
 h2 {
   font-size: 2em;
   padding-left: 8px;
+  background-color: white;
 }
 h3 {
   font-size: 1.5em;
   padding-left: 8px;
 }
+
+tr.all-columns {
+  background-color: white !important; 
+  border: none;
+}
+tr.all-columns td {
+  border-top: none !important;
+  padding-left: 0 !important;
+}
+
 .table {
   width: 100%;
 }
index 54d8015ead9de33023a3016164780746a2ff872d..ad753a82a5bb93075deb5bf466287e3bb4bb6304 100755 (executable)
        // Get all alternative names (languages, etc)
        $sSQL = "select (each(name)).key,(each(name)).value from placex where place_id = $iPlaceID order by (each(name)).key";
        $aPointDetails['aNames'] = $oDB->getAssoc($sSQL);
+       if (PEAR::isError($aPointDetails['aNames'])) // possible timeout
+       {
+               $aPointDetails['aNames'] = [];
+       }
 
        // Extra tags
        $sSQL = "select (each(extratags)).key,(each(extratags)).value from placex where place_id = $iPlaceID order by (each(extratags)).key";
        $aPointDetails['aExtraTags'] = $oDB->getAssoc($sSQL);
+       if (PEAR::isError($aPointDetails['aExtraTags'])) // possible timeout
+       {
+               $aPointDetails['aExtraTags'] = [];
+       }
 
        // Address
        $aAddressLines = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPointDetails['country_code'], true);
        // Linked places
        $sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
        $sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength ";
-       $sSQL .= " from placex, (select geometry as placegeometry from placex where place_id = $iPlaceID) as x";
+       $sSQL .= " from placex, (select centroid as placegeometry from placex where place_id = $iPlaceID) as x";
        $sSQL .= " where linked_place_id = $iPlaceID";
        $sSQL .= " order by rank_address asc,rank_search asc,get_name_by_language(name,$sLanguagePrefArraySQL),housenumber";
        $aLinkedLines = $oDB->getAll($sSQL);
+       if (PEAR::isError($aLinkedLines)) // possible timeout
+       {
+               $aLinkedLines = [];
+       }
 
        // All places this is an imediate parent of
        $sSQL = "select obj.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, ST_Distance_Spheroid(geometry, placegeometry, 'SPHEROID[\"WGS 84\",6378137,298.257223563, AUTHORITY[\"EPSG\",\"7030\"]]') as distance, ";
        $sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength ";
        $sSQL .= " from (select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, rank_search, geometry, name from placex ";
        $sSQL .= " where parent_place_id = $iPlaceID order by rank_address asc,rank_search asc limit 500) as obj,";
-       $sSQL .= " (select geometry as placegeometry from placex where place_id = $iPlaceID) as x";
+       $sSQL .= " (select centroid as placegeometry from placex where place_id = $iPlaceID) as x";
        $sSQL .= " order by rank_address asc,rank_search asc,localname,housenumber";
        $aParentOfLines = $oDB->getAll($sSQL);
+       if (PEAR::isError($aParentOfLines)) // possible timeout
+       {
+               $aParentOfLines = [];
+       }
 
        $aPlaceSearchNameKeywords = false;
        $aPlaceSearchAddressKeywords = false;
        {
                $sSQL = "select * from search_name where place_id = $iPlaceID";
                $aPlaceSearchName = $oDB->getRow($sSQL);
+               if (PEAR::isError($aPlaceSearchName)) // possible timeout
+               {
+                       $aPlaceSearchName = [];
+               }
+
                $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['name_vector'],1,-1).")";
                $aPlaceSearchNameKeywords = $oDB->getAll($sSQL);
+               if (PEAR::isError($aPlaceSearchNameKeywords)) // possible timeout
+               {
+                       $aPlaceSearchNameKeywords = [];
+               }
+
+
                $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['nameaddress_vector'],1,-1).")";
                $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL);
+               if (PEAR::isError($aPlaceSearchAddressKeywords)) // possible timeout
+               {
+                       $aPlaceSearchAddressKeywords = [];
+               }
+
        }
 
        logEnd($oDB, $hLog, 1);
 
+       $sTileURL = CONST_Map_Tile_URL;
+       $sTileAttribution = CONST_Map_Tile_Attribution;
+       
        include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');
index 1a3ae15043df2d77fa7d7a1710e75e1d91be8a53..be10807453161cd96e4c1dcd516bf9bf44ebaf59 100644 (file)
@@ -10,30 +10,23 @@ jQuery(document).on('ready', function(){
        $('#q').focus();
 
        map = new L.map('map', {
-                               attributionControl: false, // moved to page footer
+                               attributionControl: (nominatim_map_init.tile_attribution && nominatim_map_init.tile_attribution.length),
                                scrollWheelZoom:    !L.Browser.touch,
                                touchZoom:          false
                        });
 
-
-
-       L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
-               noWrap: true // otherwise we end up with click coordinates like latitude -728
+       L.tileLayer(nominatim_map_init.tile_url, {
+               noWrap: true, // otherwise we end up with click coordinates like latitude -728
                // moved to footer
-               // attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
+               attribution: (nominatim_map_init.tile_attribution || null ) //'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
        }).addTo(map);
 
-       if ( nominatim_map_init.lat ){
-               map.setView([nominatim_map_init.lat || 0, nominatim_map_init.lon], nominatim_map_init.zoom);
-
-               if ( is_reverse_search ){
-                       // not really a market, but the .circle changes radius once you zoom in/out
-                       var cm = L.circleMarker([nominatim_map_init.lat,nominatim_map_init.lon], { radius: 5, weight: 2, fillColor: '#ff7800', color: 'red', opacity: 0.75, clickable: false});
-                       cm.addTo(map);
-               }
+       map.setView([nominatim_map_init.lat, nominatim_map_init.lon], nominatim_map_init.zoom);
 
-       } else {
-               map.setView([0,0],2);
+       if ( is_reverse_search ){
+               // We don't need a marker, but an L.circle instance changes radius once you zoom in/out
+               var cm = L.circleMarker([nominatim_map_init.lat,nominatim_map_init.lon], { radius: 5, weight: 2, fillColor: '#ff7800', color: 'red', opacity: 0.75, clickable: false});
+               cm.addTo(map);
        }
 
 
@@ -188,16 +181,18 @@ jQuery(document).on('ready', function(){
                map = new L.map('map', {
                                        // center: [nominatim_map_init.lat, nominatim_map_init.lon],
                                        // zoom:   nominatim_map_init.zoom,
-                                       attributionControl: false,
+                                       attributionControl: (nominatim_map_init.tile_attribution && nominatim_map_init.tile_attribution.length),
                                        scrollWheelZoom:    false,
                                        touchZoom:          false,
                                });
 
-               L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
+
+               L.tileLayer(nominatim_map_init.tile_url, {
                        // moved to footer
-                       // attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
+                       attribution: (nominatim_map_init.tile_attribution || null ) //'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
                }).addTo(map);
 
+
                var layerGroup = new L.layerGroup().addTo(map);
 
                var circle = L.circleMarker([nominatim_result.lat,nominatim_result.lon], { radius: 10, weight: 2, fillColor: '#ff7800', color: 'blue', opacity: 0.75});
index daf0a72ddebdd5d4236b6827afcf5885a16e153a..d1603fa1e1752f68b55544ea44150dc96bf294a5 100755 (executable)
@@ -65,4 +65,6 @@
                exit;
        }
 
+       $sTileURL = CONST_Map_Tile_URL;
+       $sTileAttribution = CONST_Map_Tile_Attribution;
        include(CONST_BasePath.'/lib/template/address-'.$sOutputFormat.'.php');
index 9137beade1921d8ab619b19f80f04d24978476b7..f2c327c07fefe6760d5c51426d588c0c214c4c56 100755 (executable)
@@ -13,6 +13,8 @@
        $fLat = CONST_Default_Lat;
        $fLon = CONST_Default_Lon;
        $iZoom = CONST_Default_Zoom;
+       $sTileURL = CONST_Map_Tile_URL;
+       $sTileAttribution = CONST_Map_Tile_Attribution;
 
        $oGeocode =& new Geocode($oDB);