]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Add an entry to the edit menu for turning on the notes layer
[rails.git] / app / views / site / index.html.erb
index 8aa318a3fb8f9587b46f68058032872076e79995..4b37fc8afe0a8a2943db79f688e321d45c00cbfd 100644 (file)
@@ -6,6 +6,7 @@
 
 <% unless STATUS == :api_offline or STATUS == :database_offline -%>
   <% content_for :editmenu do -%>
+    <li><%= link_to t("browse.start_rjs.notes_layer_name"), "#", :id => "show_notes" %></li>
     <li><%= link_to t("browse.start_rjs.data_layer_name"), "#", :id => "show_data" %></li>
   <% end -%>
 <% end -%>
@@ -152,10 +153,10 @@ end
       });
       map.addLayer(map.dataLayer);
 
-      var noteLayer = addNoteLayer(map, "<%= notes_url :format => 'json' %>", $("#createnoteanchor"), 11);
+      map.noteLayer = addNoteLayer(map, "<%= notes_url :format => 'json' %>", $("#createnoteanchor"), 11);
 
       <% if params[:notes] == "yes" -%>
-      noteLayer.setVisibility(true);
+      map.noteLayer.setVisibility(true);
       <% end -%>
     <% end %>
 
@@ -206,6 +207,10 @@ end
   }
 
   $(document).ready(function () {
+    $("#show_notes").click(function () {
+      map.noteLayer.setVisibility(true);
+    });
+
     $("#show_data").click(function () {
       $.ajax({ url: "<%= url_for :controller => :browse, :action => :start %>" });
     });