]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/changeset/_map.html.erb
Replace PanZoom control with Zoom control for small maps
[rails.git] / app / views / changeset / _map.html.erb
index bc1e795b0fa4026963e144af6125775670b0842f..d20813d6205f7a883a95a08d65923b7166c6c060 100644 (file)
 
     vectors.addFeatures(highlight);
 
-    $("tr-changeset-" + id).addClassName("selected");
+    $("#tr-changeset-" + id).addClass("selected");
   }
 
   function unHighlightChangeset(id) {
     vectors.removeFeatures(highlight);
 
-    $("tr-changeset-" + id).removeClassName("selected");
+    $("#tr-changeset-" + id).removeClass("selected");
   }
 
-  function init() {
+  $(document).ready(function () {
     var map = createMap("changeset_list_map", {
       controls: [
         new OpenLayers.Control.Navigation(),
-        new OpenLayers.Control.PanZoom(),
+        new OpenLayers.Control.Zoom(),
         new OpenLayers.Control.PanZoomBar()
       ]
     });
     selectControl.activate();
 
     <% if ! @bbox.nil? %>
-      setMapExtent(new OpenLayers.Bounds(<%= @bbox %>));
+      map.zoomToExtent(proj(new OpenLayers.Bounds(<%= @bbox %>)));
     <% else %>
-      setMapExtent(bounds);
+      map.zoomToExtent(proj(bounds));
     <% end %>
-  }
-
-  Event.observe(window, "load", init);
+  });
 </script>