X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d702a29810989e36a1fc2633ae424ee25e07967f..f973bee52b375af9228b972f8740676b86f06f88:/app/controllers/geocoder_controller.rb diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 8394b3e6e..2af95e5fa 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -253,7 +253,8 @@ class GeocoderController < ApplicationController type = place.attributes["type"].to_s name = place.attributes["display_name"].to_s min_lat,max_lat,min_lon,max_lon = place.attributes["boundingbox"].to_s.split(",") - prefix = t "geocoder.search_osm_nominatim.prefix.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize + prefix_name = t "geocoder.search_osm_nominatim.prefix.#{klass}.#{type}", :default => type.gsub("_", " ").capitalize + prefix = t "geocoder.search_osm_nominatim.prefix_format", :name => prefix_name @results.push({:lat => lat, :lon => lon, :min_lat => min_lat, :max_lat => max_lat, @@ -357,8 +358,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