]> git.openstreetmap.org Git - rails.git/blob - app/controllers/export_controller.rb
Merge pull request #11 from danstowell/jsrouting-pulldownchange
[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   #When the user clicks 'Export' we redirect to a URL which generates the export download
9   def finish
10     bbox = BoundingBox.from_lon_lat_params(params)
11     format = params[:format]
12
13     if format == "osm"
14       #redirect to API map get
15       redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
16
17     elsif format == "mapnik"
18       #redirect to a special 'export' cgi script
19       format = params[:mapnik_format]
20       scale = params[:mapnik_scale]
21
22       redirect_to "http://render.openstreetmap.org/cgi-bin/export?bbox=#{bbox}&scale=#{scale}&format=#{format}"
23     end
24   end
25
26   def embed
27   end
28 end