2 def result_to_html(result)
3 html_options = { :class => "set_position", :data => {} }
5 if result[:min_lon] and result[:min_lat] and result[:max_lon] and result[:max_lat]
6 url = "?minlon=#{result[:min_lon]}&minlat=#{result[:min_lat]}&maxlon=#{result[:max_lon]}&maxlat=#{result[:max_lat]}"
8 url = "?mlat=#{result[:lat]}&mlon=#{result[:lon]}&zoom=#{result[:zoom]}"
11 result.each do |key,value|
12 html_options[:data][key.to_s.tr('_', '-')] = value
16 html << result[:prefix] if result[:prefix]
17 html << " " if result[:prefix] and result[:name]
18 html << link_to(result[:name], url, html_options) if result[:name]
19 html << result[:suffix] if result[:suffix]
21 # if result[:type] and result[:id]
22 # html << content_tag(:small, :class => ["deemphasize", "search_details"]) do
23 # link_to(t("browse.#{result[:type]}_history.view_details"), :controller => :browse, :action => result[:type], :id => result[:id])
30 def describe_location(lat, lon, zoom = nil, language = nil)
31 Nominatim.describe_location(lat, lon, zoom, language)