]> git.openstreetmap.org Git - rails.git/blob - app/controllers/export_controller.rb
Remove unused gem and add a comment where it was replaced
[rails.git] / app / controllers / export_controller.rb
1 class ExportController < ApplicationController
2
3   before_filter :authorize_web
4   before_filter :set_locale
5
6   def start
7     render :partial => "sidebar"
8   end
9
10   #When the user clicks 'Export' we redirect to a URL which generates the export download
11   def finish
12     bbox = BoundingBox.from_lon_lat_params(params)
13     format = params[:format]
14
15     if format == "osm"
16       #redirect to API map get
17       redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
18
19     elsif format == "mapnik"
20       #redirect to a special 'export' cgi script
21       format = params[:mapnik_format]
22       scale = params[:mapnik_scale]
23
24       redirect_to "http://parent.tile.openstreetmap.org/cgi-bin/export?bbox=#{bbox}&scale=#{scale}&format=#{format}"
25     end
26   end
27 end