From e076d824bf6fd6d50ab609b2bbc33b450f1274cd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 27 Feb 2010 12:52:30 +0000 Subject: [PATCH] Make sure we report "no results" when Nominatim's reverse geocoder fails to find any results. --- app/controllers/geocoder_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 8394b3e6e..aaa8d17ef 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -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 -- 2.39.5