]> git.openstreetmap.org Git - rails.git/commitdiff
Wait for the page to finish loading before trying to add any data
authorTom Hughes <tom@compton.nu>
Fri, 26 Feb 2010 14:46:02 +0000 (14:46 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 26 Feb 2010 14:46:02 +0000 (14:46 +0000)
object to the map as IE won't be ready to draw vectors until the
page is fully loaded. Closes #2692.

app/views/site/index.html.erb

index 0602b6f11598b855b96955ae6055c6c12a6b49f2..636e6929c3b8491b3421117e79b741759067b4ac 100644 (file)
@@ -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);