From: Tom Hughes Date: Fri, 26 Feb 2010 14:46:02 +0000 (+0000) Subject: Wait for the page to finish loading before trying to add any data X-Git-Tag: live~6389^2~13 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/dfec61084a0f943860bae1bf3a6bd6b162a7ce42 Wait for the page to finish loading before trying to add any data object to the map as IE won't be ready to draw vectors until the page is fully loaded. Closes #2692. --- diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 0602b6f11..636e6929c 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -170,7 +170,8 @@ end url += "/full"; <% end %> - addObjectToMap(url, <%= object_zoom %>); + // IE requires Vector layers be initialised on page load, and not under deferred script conditions + Event.observe(window, 'load', function() { addObjectToMap(url, <%= object_zoom %>) }); <% end %> map.events.register("moveend", map, updateLocation);