1 class ExportController < ApplicationController
2 before_filter :authorize_web
3 before_filter :set_locale
7 # When the user clicks 'Export' we redirect to a URL which generates the export download
9 bbox = BoundingBox.from_lon_lat_params(params)
10 format = params[:format]
13 # redirect to API map get
14 redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
16 elsif format == "mapnik"
17 # redirect to a special 'export' cgi script
18 format = params[:mapnik_format]
19 scale = params[:mapnik_scale]
21 redirect_to "http://render.openstreetmap.org/cgi-bin/export?bbox=#{bbox}&scale=#{scale}&format=#{format}"