X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6baccfaddd190d730b626204e9cf81c2504995bf..843d601b0a4df3e0cb81fdedc8e7f7e55379e0e0:/app/views/site/index.html.erb?ds=sidebyside diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 40a7a3fbc..12cc1d275 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -191,10 +191,16 @@ end return getMapCenter(); } - function setPosition(lat, lon, zoom) { + function setPosition(lat, lon, zoom, min_lon, min_lat, max_lon, max_lat) { var centre = new OpenLayers.LonLat(lon, lat); - setMapCenter(centre, zoom); + if (min_lon && min_lat && max_lon && max_lat) { + var bbox = new OpenLayers.Bounds(min_lon, min_lat, max_lon, max_lat); + + setMapExtent(bbox); + } else { + setMapCenter(centre, zoom); + } if (marker) removeMarkerFromMap(marker);