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