1 class ExportController < ApplicationController
2 before_action :authorize_web
3 before_action :set_locale
4 before_action :update_totp, :only => [:finish]
8 # When the user clicks 'Export' we redirect to a URL which generates the export download
10 bbox = BoundingBox.from_lon_lat_params(params)
11 format = params[:format]
14 # redirect to API map get
15 redirect_to :controller => "api", :action => "map", :bbox => bbox
17 elsif format == "mapnik"
18 # redirect to a special 'export' cgi script
19 format = params[:mapnik_format]
20 scale = params[:mapnik_scale]
22 redirect_to "http://render.openstreetmap.org/cgi-bin/export?bbox=#{bbox}&scale=#{scale}&format=#{format}"