X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b0ed31b6d48da40f90d3fd0e0aa71394984a6c76..20f1939c4c61ef28b128593b2ae5f841af567042:/lib/template/search-html.php?ds=inline diff --git a/lib/template/search-html.php b/lib/template/search-html.php index 986b4e4d..7698ebd0 100644 --- a/lib/template/search-html.php +++ b/lib/template/search-html.php @@ -208,7 +208,7 @@ form{ map.panTo(lonLat, ); } - 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); @@ -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 lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); + map.panTo(lonLat, ); var pointList = []; var style = { @@ -290,10 +292,11 @@ form{ projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326"), eventListeners: { - "moveend": mapEventMove, + "moveend": mapEventMove } } ); - map.addLayer(new OpenLayers.Layer.OSM.("Default")); + map.addLayer(new OpenLayers.Layer.OSM.("Default", + { attribution : '© OpenStreetMap and contributors, under an open license'})); var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); layer_style.fillOpacity = 0.2; @@ -317,7 +320,7 @@ form{
-
+ @@ -330,7 +333,7 @@ form{ Documentation | FAQ - +
Thank you for your problem report
@@ -356,7 +359,7 @@ target="_blank">FAQ 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'])) @@ -368,11 +371,14 @@ target="_blank">FAQ echo '
'; } - echo ($aResult['icon']?'':''); + echo (isset($aResult['icon'])?'':''); echo ' '.$aResult['name'].''; - echo ' '.round($aResult['lat'],3).','.round($aResult['lat'],3).''; + echo ' '.round($aResult['lat'],3).','.round($aResult['lon'],3).''; echo ' '.$aResult['place_id'].''; - echo ' ('.ucwords(str_replace('_',' ',$aResult['type'])).')'; + if (isset($aResult['label'])) + echo ' ('.$aResult['label'].')'; + else + echo ' ('.ucwords(str_replace('_',' ',$aResult['type'])).')'; echo ' (details)'; echo '
'; } @@ -445,7 +451,11 @@ init(); echo ', '.$aResult['aBoundingBox'][1]; echo ', '.$aResult['aBoundingBox'][2]; echo ', '.$aResult['aBoundingBox'][3]; - echo ', '.javascript_renderData($aResult['aPolyPoints']); + if (isset($aResult['aPolyPoints'])) + { + echo ', '; + echo javascript_renderData($aResult['aPolyPoints']); + } echo ');'."\n"; } else