X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/490226ad6d28cf9eff1fc78c7c69bef750321614..898cc828dd1f1167f85abbf35c8e3f0ed640ac1e:/app/helpers/geocoder_helper.rb?ds=sidebyside diff --git a/app/helpers/geocoder_helper.rb b/app/helpers/geocoder_helper.rb index 735ac8153..8f662bde7 100644 --- a/app/helpers/geocoder_helper.rb +++ b/app/helpers/geocoder_helper.rb @@ -1,6 +1,6 @@ module GeocoderHelper def result_to_html(result) - html_options = { :class => "set_position" } + html_options = { :class => "set_position", :data => {} } if result[:min_lon] and result[:min_lat] and result[:max_lon] and result[:max_lat] url = "?minlon=#{result[:min_lon]}&minlat=#{result[:min_lat]}&maxlon=#{result[:max_lon]}&maxlat=#{result[:max_lat]}" @@ -9,7 +9,7 @@ module GeocoderHelper end result.each do |key,value| - html_options["data-#{key.to_s.tr('_', '-')}"] = value + html_options[:data][key.to_s.tr('_', '-')] = value end html = "" @@ -20,4 +20,8 @@ module GeocoderHelper return raw(html) end + + def describe_location(lat, lon, zoom = nil, language = nil) + Nominatim.describe_location(lat, lon, zoom, language) + end end