X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/64fb530581ffd21e2522e70e8a2d4c46d666f760..92951c6c00be0cb488a97463e25a5ecc8272c49e:/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..150bdce4d 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -191,10 +191,20 @@ end return getMapCenter(); } - function setPosition(lat, lon, zoom) { + function getZoom() { + return getMapZoom(); + } + + 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);