X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/344c5534ee328243ce8f5787e0ef6c3dcbf87b15..6206ab7fe75362155c8b9565a1bd512a9f7ce443:/app/views/site/index.html.erb diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index a74c7b356..8aa318a3f 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -25,6 +25,7 @@ @@ -127,6 +128,7 @@ end <%= javascript_include_tag 'openlayers.js' %> <%= javascript_include_tag 'map.js' %> +<%= javascript_include_tag 'notes.js' %> <%= render :partial => 'resize' %> @@ -136,6 +138,10 @@ end OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>"); + <% if @user %> + var loginName = "<%= @user.display_name %>" + <% end %> + function mapInit(){ map = createMap("map"); @@ -145,6 +151,12 @@ end displayInLayerSwitcher: false }); map.addLayer(map.dataLayer); + + var noteLayer = addNoteLayer(map, "<%= notes_url :format => 'json' %>", $("#createnoteanchor"), 11); + + <% if params[:notes] == "yes" -%> + noteLayer.setVisibility(true); + <% end -%> <% end %> <% unless object_zoom %> @@ -288,7 +300,7 @@ end $(document).ready(function () { $("#exportanchor").click(function (e) { $.ajax({ url: "<%= url_for :controller => :export, :action => :start %>" }); - Event.stop(e); + e.preventDefault(); }); <% if params[:action] == 'export' -%>