<% 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"), { :controller => :browse, :action => :start }, :id => "show_data" %></li>
<% end -%>
<% end -%>
<div id="permalink">
<a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a>
<a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
+ <a href="#" id="createnoteanchor">Report a problem</a>
</div>
</div>
</table>
</div>
+<div id="new-note" class="hidden"><%= render :partial => "notes/new" %></div>
+
<script type="text/javascript">
var marker;
var map;
var params = OSM.mapParams();
+ <% if @user %>
+ var loginName = "<%= @user.display_name %>"
+ <% end %>
+
function mapInit(){
map = createMap("map");
+ <% unless STATUS == :api_offline or STATUS == :database_offline %>
+ map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", {
+ visibility: false,
+ displayInLayerSwitcher: false
+ });
+ map.addLayer(map.dataLayer);
+
+ map.noteLayer = addNoteLayer(map, "<%= notes_url :format => 'json' %>", $("#createnoteanchor"), $("#new-note"), 11);
+
+ <% if params[:notes] == "yes" -%>
+ map.noteLayer.setVisibility(true);
+ <% end -%>
+ <% end %>
+
if (!params.object_zoom) {
if (params.bbox) {
var bbox = new OpenLayers.Bounds(params.minlon, params.minlat, params.maxlon, params.maxlat);
}
$(document).ready(function () {
+ $("#show_notes").click(function () {
+ map.noteLayer.setVisibility(true);
+ });
+
$("#show_data").click(function (e) {
$.ajax({ url: $(this).attr('href'), success: function (sidebarHtml) {
startBrowse(sidebarHtml);