- bbox = BoundingBox.new(params[:minlon], params[:minlat], params[:maxlon], params[:maxlat])
- format = params[:format]
-
- if format == "osm"
- #redirect to API map get
- redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
-
- elsif format == "mapnik"
- #redirect to a special 'export' cgi script
- format = params[:mapnik_format]
+ bbox = BoundingBox.from_lon_lat_params(params)
+ style = params[:format]
+ format = params[:mapnik_format]
+
+ case style
+ when "osm"
+ # redirect to API map get
+ redirect_to :controller => "api/map", :action => "index", :bbox => bbox
+
+ when "mapnik"
+ # redirect to a special 'export' cgi script