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.
 
 
 
 
 

22 lines
576 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)
  5. layar_response = {
  6. :layer => 'hyparlocal',
  7. :hotspots => @posts.collect { |p| post_to_poi(p) },
  8. :errorCode => 0, # OK
  9. :errorString => "OK",
  10. :radius => params[:radius].to_f
  11. }
  12. respond_to do |format|
  13. format.html # near.html.erb
  14. format.json { render json: @posts }
  15. format.layar { render json: layar_response }
  16. end
  17. end
  18. end