GeoRSS aggregator and Layar augmented reality server
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

28 lignes
688 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. 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