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.
var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
bounds.extend(bbox);
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({
<% end %>
vectors.events.on({
<%= render :partial => preferred_editor %>
<%= render :partial => preferred_editor %>
-<script type="text/javascript" defer="defer">
+<script type="text/javascript">
function maximiseMap() {
$("left").style.display = "none";
$("greeting").style.display = "none";
function maximiseMap() {
$("left").style.display = "none";
$("greeting").style.display = "none";
+ document.observe("dom:loaded", handleResize);
- Event.observe(window, "load", handleResize);
Event.observe(window, "resize", handleResize);
</script>
<% end %>
Event.observe(window, "resize", handleResize);
</script>
<% end %>
<%= render :partial => 'resize' %>
<%= render :partial => 'resize' %>
-<script type="text/javascript" defer="defer">
+<script type="text/javascript">
setMapExtent(bbox);
<% if box %>
setMapExtent(bbox);
<% if box %>
- // IE requires Vector layers be initialised on page load, and not under deferred script conditions
- Event.observe(window, 'load', function() { addBoxToMap(bbox) });
+ Event.observe(window, "load", function() { addBoxToMap(bbox) });
<% end %>
<% else %>
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
<% end %>
<% else %>
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
url += "/full";
<% end %>
url += "/full";
<% end %>
- // IE requires Vector layers be initialised on page load, and not under deferred script conditions
- Event.observe(window, 'load', function() { addObjectToMap(url, <%= object_zoom %>) });
+ Event.observe(window, "load", function() { addObjectToMap(url, <%= object_zoom %>) });
<% end %>
map.events.register("moveend", map, updateLocation);
<% end %>
map.events.register("moveend", map, updateLocation);
- mapInit();
-
- Event.observe(window, "load", installEditHandler);
- Event.observe(window, "load", handleResize);
+ document.observe("dom:loaded", mapInit);
+ document.observe("dom:loaded", installEditHandler);
+ document.observe("dom:loaded", handleResize);
Event.observe(window, "resize", function() {
var centre = map.getCenter();
Event.observe(window, "resize", function() {
var centre = map.getCenter();