X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/701325e9ef6720a16646c7218010e33b5c58d544..d101306d3be2d1dc75d78173c86085987db6f029:/app/views/changeset/_map.html.erb diff --git a/app/views/changeset/_map.html.erb b/app/views/changeset/_map.html.erb index f052eadbe..a490ad1d8 100644 --- a/app/views/changeset/_map.html.erb +++ b/app/views/changeset/_map.html.erb @@ -37,7 +37,7 @@ $("#tr-changeset-" + id).removeClass("selected"); } - function init() { + $(document).ready(function () { var map = createMap("changeset_list_map", { controls: [ new OpenLayers.Control.Navigation(), @@ -80,11 +80,9 @@ selectControl.activate(); <% if ! @bbox.nil? %> - map.setExtent(proj(new OpenLayers.Bounds(<%= @bbox %>))); + map.zoomToExtent(proj(new OpenLayers.Bounds(<%= @bbox %>))); <% else %> - map.setExtent(proj(bounds)); + map.zoomToExtent(proj(bounds)); <% end %> - } - - Event.observe(window, "load", init); + });