- page.replace_html :sidebar_content, :partial => 'results', :object => results
-
- if results_count == 1
- position = results.collect { |s| s[:results] }.compact.flatten[0]
- page.call "setPosition", position[:lat].to_f, position[:lon].to_f, position[:zoom].to_i
- else
- page.call "openSidebar"
- end
- end
- end
-
- def description
- results = Array.new
-
- lat = params[:lat]
- lon = params[:lon]
-
- results.push description_osm_namefinder("cities", lat, lon, 2)
- results.push description_osm_namefinder("towns", lat, lon, 4)
- results.push description_osm_namefinder("places", lat, lon, 10)
- results.push description_geonames(lat, lon)
-
- render :update do |page|
- page.replace_html :sidebar_content, :partial => 'results', :object => results