]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/search-html.php
use json_encode in search stuff as well
[nominatim.git] / lib / template / search-html.php
index a9d328a8928f7b20ab0cad8aa60a30dfc685d0cf..89e4800be35fa76fbaf4a4964a7a40ccbadffcf0 100644 (file)
@@ -208,7 +208,7 @@ form{
                        map.panTo(lonLat, <?php echo $iZoom ?>);
                }
 
                        map.panTo(lonLat, <?php echo $iZoom ?>);
                }
 
-               function panToLatLonZoom(lat,lon, zoom) {
+               function panToLatLonZoom(lat, lon, zoom) {
                        var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
                        if (zoom != map.getZoom())
                                map.setCenter(lonLat, zoom);
                        var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
                        if (zoom != map.getZoom())
                                map.setCenter(lonLat, zoom);
@@ -220,6 +220,8 @@ form{
                        var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
                        var proj_map = map.getProjectionObject();
                         map.zoomToExtent(new OpenLayers.Bounds(minlon,minlat,maxlon,maxlat).transform(proj_EPSG4326, proj_map));
                        var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
                        var proj_map = map.getProjectionObject();
                         map.zoomToExtent(new OpenLayers.Bounds(minlon,minlat,maxlon,maxlat).transform(proj_EPSG4326, proj_map));
+                       var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
+                       map.panTo(lonLat, <?php echo $iZoom ?>);
 
                         var pointList = [];
                         var style = {
 
                         var pointList = [];
                         var style = {
@@ -317,7 +319,7 @@ form{
        <div id="seachheaderfade1"></div><div id="seachheaderfade2"></div><div id="seachheaderfade3"></div><div id="seachheaderfade4"></div>
 
        <div id="seachheader">
        <div id="seachheaderfade1"></div><div id="seachheaderfade2"></div><div id="seachheaderfade3"></div><div id="seachheaderfade4"></div>
 
        <div id="seachheader">
-               <form action="<?php echo CONST_Website_BaseURL; ?>search.php" method="get">
+               <form accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php" method="get">
                        <table border="0" width="100%">
                                <tr>
                                        <td valign="center" style="width:30px;"><img src="images/logo.gif"></td>
                        <table border="0" width="100%">
                                <tr>
                                        <td valign="center" style="width:30px;"><img src="images/logo.gif"></td>
@@ -330,7 +332,7 @@ form{
 <a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a> | <a href="http://wiki.openstreetmap.org/wiki/Nominatim/FAQ" 
 target="_blank">FAQ</a></td>
 
 <a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a> | <a href="http://wiki.openstreetmap.org/wiki/Nominatim/FAQ" 
 target="_blank">FAQ</a></td>
 
-<?php } ?>                                     <td style="text-align:right;"><?php if ($sQuery) { if ($sReportDescription) {?><div style="text-align:center;"><b>Thank you for your problem report</b></div><?php } else { ?><input type="button" value="Report Problem With Results" onclick="$('report').style.visibility=($('report').style.visibility=='hidden'?'visible':'hidden')"><?php }} ?></td>
+<?php } ?>                                     <td style="text-align:right;"><?php if ($sQuery) { ?><input type="button" value="Report Problem With Results" onclick="$('report').style.visibility=($('report').style.visibility=='hidden'?'visible':'hidden')"><?php } ?></td>
                                </tr>
                        </table>
                </form>
                                </tr>
                        </table>
                </form>
@@ -356,7 +358,7 @@ target="_blank">FAQ</a></td>
                        echo ', '.$aResult['aBoundingBox'][1];
                        echo ', '.$aResult['aBoundingBox'][2];
                        echo ', '.$aResult['aBoundingBox'][3];
                        echo ', '.$aResult['aBoundingBox'][1];
                        echo ', '.$aResult['aBoundingBox'][2];
                        echo ', '.$aResult['aBoundingBox'][3];
-                       echo ', '.javascript_renderData($aResult['aPolyPoints']);
+                       if (isset($aResult['aPolyPoints'])) echo ', '.json_encode($aResult['aPolyPoints']);
                        echo ');\'>';
                }
                elseif (isset($aResult['zoom']))
                        echo ');\'>';
                }
                elseif (isset($aResult['zoom']))
@@ -368,7 +370,7 @@ target="_blank">FAQ</a></td>
                        echo '<div class="result" onClick="panToLatLon('.$aResult['lat'].', '.$aResult['lon'].');">';
                }
 
                        echo '<div class="result" onClick="panToLatLon('.$aResult['lat'].', '.$aResult['lon'].');">';
                }
 
-               echo ($aResult['icon']?'<img src="'.$aResult['icon'].'">':'');
+               echo (isset($aResult['icon'])?'<img src="'.$aResult['icon'].'">':'');
                echo ' <span class="name">'.$aResult['name'].'</span>';
                echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lat'],3).'</span>';
                echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
                echo ' <span class="name">'.$aResult['name'].'</span>';
                echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lat'],3).'</span>';
                echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
@@ -448,7 +450,7 @@ init();
                        echo ', '.$aResult['aBoundingBox'][1];
                        echo ', '.$aResult['aBoundingBox'][2];
                        echo ', '.$aResult['aBoundingBox'][3];
                        echo ', '.$aResult['aBoundingBox'][1];
                        echo ', '.$aResult['aBoundingBox'][2];
                        echo ', '.$aResult['aBoundingBox'][3];
-                       echo ', '.javascript_renderData($aResult['aPolyPoints']);
+                       if (isset($aResult['aPolyPoints'])) echo ', '.javascript_renderData($aResult['aPolyPoints']);
                        echo ');'."\n";
                }
                else
                        echo ');'."\n";
                }
                else