Make sure we report "no results" when Nominatim's reverse geocoder fails
to find any results.
This commit is contained in:
parent
0b913efd05
commit
e076d824bf
1 changed files with 2 additions and 2 deletions
|
@ -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(',')}")
|
response = fetch_xml("http://nominatim.openstreetmap.org/reverse?lat=#{lat}&lon=#{lon}&zoom=#{zoom}&accept-language=#{request.user_preferred_languages.join(',')}")
|
||||||
|
|
||||||
# parse the response
|
# parse the response
|
||||||
response.elements.each("reversegeocode") do |result|
|
response.elements.each("reversegeocode/result") do |result|
|
||||||
description = result.get_text("result").to_s
|
description = result.get_text.to_s
|
||||||
|
|
||||||
@results.push({:prefix => "#{description}"})
|
@results.push({:prefix => "#{description}"})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue