X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0eb2b79b7ee19bcf6254cd0d652b9f1248a0fe8..17e07539629ee8a1fdb5bebbb4c287720905066e:/app/views/site/index.html.erb 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);