]> git.openstreetmap.org Git - rails.git/commitdiff
Use local api to export map.osm
authorHan Chao <hanchao0123@hotmail.com>
Sun, 5 Mar 2017 10:37:25 +0000 (10:37 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 5 Mar 2017 10:37:25 +0000 (10:37 +0000)
Closes #1282

app/controllers/export_controller.rb
test/controllers/export_controller_test.rb

index 6e5016ddce4ec7eb6b0fcfaab09fb9634ffe8045..1b7beaad696dd8ca3503babaa26e67748a70e511 100644 (file)
@@ -12,7 +12,7 @@ class ExportController < ApplicationController
 
     if format == "osm"
       # redirect to API map get
 
     if format == "osm"
       # redirect to API map get
-      redirect_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=#{bbox}"
+      redirect_to :controller => "api", :action => "map", :bbox => bbox
 
     elsif format == "mapnik"
       # redirect to a special 'export' cgi script
 
     elsif format == "mapnik"
       # redirect to a special 'export' cgi script
index adf2fc4bad83256d2b1b25ea560eea95ddd11199..9d1c69e4dc61f96c3e1c21381c42ec61b12639b0 100644 (file)
@@ -19,7 +19,7 @@ class ExportControllerTest < ActionController::TestCase
   def test_finish_osm
     get :finish, :minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => "osm"
     assert_response :redirect
   def test_finish_osm
     get :finish, :minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => "osm"
     assert_response :redirect
-    assert_redirected_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=0.0,50.0,1.0,51.0"
+    assert_redirected_to "controller" => "api", "action" => "map", "bbox" => "0.0,50.0,1.0,51.0"
   end
 
   ###
   end
 
   ###