allow the user to pass in a gpx and a zoom
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 21 May 2009 17:25:39 +0000 (17:25 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Thu, 21 May 2009 17:25:39 +0000 (17:25 +0000)
app/views/site/edit.rhtml

index 372a70d3bdff204d48128cccf1ea7e85c71b0a5e..d8f556d9f35269034f6ac7d12ddcdd4d01c7b1cc 100644 (file)
@@ -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 %>