]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/geocoder_helper.rb
Merge branch 'master' into notes
[rails.git] / app / helpers / geocoder_helper.rb
index 735ac815302f8ec86ec0c5a97bd8e71fc3ccee6b..8f662bde73d304e7944b3c1195dca1b2cf407db1 100644 (file)
@@ -1,6 +1,6 @@
 module GeocoderHelper
   def result_to_html(result)
 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]}"
 
     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|
     end
 
     result.each do |key,value|
-      html_options["data-#{key.to_s.tr('_', '-')}"] = value
+      html_options[:data][key.to_s.tr('_', '-')] = value
     end
 
     html = ""
     end
 
     html = ""
@@ -20,4 +20,8 @@ module GeocoderHelper
 
     return raw(html)
   end
 
     return raw(html)
   end
+
+  def describe_location(lat, lon, zoom = nil, language = nil)
+    Nominatim.describe_location(lat, lon, zoom, language)
+  end
 end
 end