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