2 def result_to_html(result)
3 html_options = { :class => "set_position", :data => {} }
5 if result[:type] && result[:id]
6 url = url_for(:controller => :browse, :action => result[:type], :id => result[:id])
7 elsif result[:min_lon] && result[:min_lat] && result[:max_lon] && result[:max_lat]
8 url = "/?bbox=#{result[:min_lon]},#{result[:min_lat]},#{result[:max_lon]},#{result[:max_lat]}"
10 url = "/#map=#{result[:zoom]}/#{result[:lat]}/#{result[:lon]}"
13 result.each do |key, value|
14 html_options[:data][key.to_s.tr('_', '-')] = value
18 html << result[:prefix] if result[:prefix]
19 html << " " if result[:prefix] && result[:name]
20 html << link_to(result[:name], url, html_options) if result[:name]
21 html << result[:suffix] if result[:suffix]
25 def describe_location(lat, lon, zoom = nil, language = nil)
26 Nominatim.describe_location(lat, lon, zoom, language)