GeoRSS aggregator and Layar augmented reality server
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

28 řádky
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