GeoRSS aggregator and Layar augmented reality server
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

22 linhas
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