GeoRSS aggregator and Layar augmented reality server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
717 B

  1. class PostsController < ApplicationController
  2. include PostsHelper
  3. def near
  4. @posts = Post.near(params[:lat].to_f, params[:lon].to_f, params[:radius].to_f, params[:layer_id])
  5. # ErrorLog.create(
  6. # :ts => Time.now,
  7. # :params => params,
  8. # :pois_returned => @posts.size
  9. # )
  10. layar_response = {
  11. :layer => 'hyparlocal',
  12. :hotspots => @posts.collect { |p| post_to_poi(p) },
  13. :errorCode => 0, # OK
  14. :errorString => "OK",
  15. :radius => params[:radius].to_f
  16. }
  17. respond_to do |format|
  18. format.html # near.html.erb
  19. format.json { render json: @posts }
  20. format.layar { render json: layar_response }
  21. end
  22. end
  23. end