]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/edit.rhtml
allow the user to pass in a gpx and a zoom
[rails.git] / app / views / site / edit.rhtml
index a3a2b532a81858d3a45c93fdabcf65c48e92ea91..d8f556d9f35269034f6ac7d12ddcdd4d01c7b1cc 100644 (file)
@@ -8,8 +8,8 @@
 </p>
 <% elsif !@user.data_public? %>
 <p>You haven't set your edits to be public.</p>
-<p>You can't use the online editor unless you do so. You can set your edits as public from your 
-<%= link_to 'user page', {:controller => 'user', :action => 'account', :display_name => @user.display_name}%>.</p>
+<p>You can no longer edit the map unless you do so. You can set your edits as public from your 
+<%= link_to 'user page', {:controller => 'user', :action => 'account', :display_name => @user.display_name, :anchor => 'public'}%>.</p>
 <p>(<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">Find out why this is the case.</a>)</p>
 <% else %>
 <% content_for :greeting do %>
@@ -36,6 +36,10 @@ elsif params['mlon'] and params['mlat']
        zoom =  h(params['zoom'])
        
 elsif params['gpx']
+        # The user may pass a gpx and zoom
+       if params['zoom']
+          zoom = h(params['zoom'])
+       end
        #use gpx id to locate (dealt with below)
        
 elsif cookies.key?("_osm_location")
@@ -83,6 +87,7 @@ zoom='14' if zoom.nil?
     fo.addVariable('token','<%= session[:token] %>');
     if (lat) { fo.addVariable('lat',lat); }
     if (lon) { fo.addVariable('long',lon); }
+    if (zoom) { fo.addVariable('zoom',zoom); }
     <% if params['gpx']  %>fo.addVariable('gpx' ,'<%= h(params['gpx'] ) %>');<% end %>
     <% if params['way']  %>fo.addVariable('way' ,'<%= h(params['way'] ) %>');<% end %>
     <% if params['node'] %>fo.addVariable('node','<%= h(params['node']) %>');<% end %>