]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/geocoder_controller.rb
Make sure we report "no results" when Nominatim's reverse geocoder fails
[rails.git] / app / controllers / geocoder_controller.rb
index 8394b3e6e0c9f70b5c124daff923a1970cccc36c..aaa8d17ef114524cff62490b5db150279dee5d6c 100644 (file)
@@ -357,8 +357,8 @@ class GeocoderController < ApplicationController
     response = fetch_xml("http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{request.user_preferred_languages.join(',')}")
 
     # parse the response
-    response.elements.each("reversegeocode") do |result|
-      description = result.get_text("result").to_s
+    response.elements.each("reversegeocode/result") do |result|
+      description = result.get_text.to_s
 
       @results.push({:prefix => "#{description}"})
     end