]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Use the correct name for the interpolation variable
[rails.git] / app / views / site / index.html.erb
index 12cc1d275e4d7c0817f7bb4a5dd369bd0c93f72f..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);
@@ -182,7 +183,7 @@ end
   function toggleData() {
     if (map.dataLayer.visibility) {
       <%= remote_function :url => { :controller => 'browse', :action => 'start' } %>
-    } else {
+    } else if (map.dataLayer.active) {
       closeSidebar();
     }
   }
@@ -191,6 +192,10 @@ end
     return getMapCenter();
   }
 
+  function getZoom() {
+    return getMapZoom();
+  }
+
   function setPosition(lat, lon, zoom, min_lon, min_lat, max_lon, max_lat) {
     var centre = new OpenLayers.LonLat(lon, lat);