X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f364dd8f005aaed40d6a6687bd22c034cfd9e3a3..ada8b184ea9820b6bfa8926e97e809d4a9a5c44d:/app/controllers/geocoder_controller.rb diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 29e7648af..2b03790aa 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -26,12 +26,7 @@ class GeocoderController < ApplicationController @sources.push "osm_nominatim" else @sources.push "osm_nominatim" - @sources.push "geonames" - end - - render :update do |page| - page.replace_html :sidebar_content, :partial => "search" - page.call "openSidebar" + @sources.push "geonames" if defined?(GEONAMES_USERNAME) end end @@ -264,9 +259,9 @@ class GeocoderController < ApplicationController end render :action => "results" - rescue Exception => ex - @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}" - render :action => "error" +# rescue Exception => ex +# @error = "Error contacting nominatim.openstreetmap.org: #{ex.to_s}" +# render :action => "error" end def search_geonames @@ -277,7 +272,7 @@ class GeocoderController < ApplicationController @results = Array.new # ask geonames.org - response = fetch_xml("http://ws.geonames.org/search?q=#{escape_query(query)}&maxRows=20") + response = fetch_xml("http://api.geonames.org/search?q=#{escape_query(query)}&maxRows=20&username=#{GEONAMES_USERNAME}") # parse the response response.elements.each("geonames/geoname") do |geoname| @@ -302,11 +297,6 @@ class GeocoderController < ApplicationController @sources.push({ :name => "osm_nominatim" }) @sources.push({ :name => "geonames" }) - - render :update do |page| - page.replace_html :sidebar_content, :partial => "description" - page.call "openSidebar" - end end def description_osm_namefinder