From: Tom Hughes Date: Thu, 7 Jul 2011 09:02:42 +0000 (+0100) Subject: Wait for dom:loaded to fire before initialising the map X-Git-Tag: live~6241 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7e4ceec192572936f5618d6e834bd5cea4f26b80?ds=sidebyside Wait for dom:loaded to fire before initialising the map Also very all our use of window.onload and switch to using dom:loaded instead where we can - the main case where we can't is when using a vector layer as IE will fail unless the page is completely loaded. --- diff --git a/app/views/changeset/_map.html.erb b/app/views/changeset/_map.html.erb index 5f5f4aa5d..39906af08 100644 --- a/app/views/changeset/_map.html.erb +++ b/app/views/changeset/_map.html.erb @@ -57,7 +57,8 @@ var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat); bounds.extend(bbox); - box = addBoxToMap(bbox, "<%= edit.id %>", true); + + addBoxToMap(bbox, "<%= edit.id %>", true); <% end %> vectors.events.on({ diff --git a/app/views/site/edit.html.erb b/app/views/site/edit.html.erb index fdbfa5428..37531a4a7 100644 --- a/app/views/site/edit.html.erb +++ b/app/views/site/edit.html.erb @@ -22,7 +22,7 @@ <%= render :partial => preferred_editor %> - <% end %> diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 84ffcbe59..1f1313c53 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -120,7 +120,7 @@ end <%= render :partial => 'resize' %> -