Don't like ads? PRO users don't see any ads ;-)
Guest

Grails atmosphere plugin problem

By: a guest on Apr 7th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def builder = new JSONBuilder()
  2. def jsonResult = builder.build{
  3.         artist = "incubus"
  4.         location = {
  5.                 lat = 45.678909
  6.                 lng = -14.45667
  7.         }
  8.     }
  9.  
  10. broadcaster['/atmosphere/recommend'].broadcast(jsonResult)
  11.        
  12. [[lat:45.678909,lng:-14.45667],[lat:32.56433,lng:22.4566]].each{
  13.         def builder = new JSONBuilder()
  14.         def jsonResult = builder.build{
  15.             artist = "incubus"
  16.             location = {
  17.                 lat = '"${it.lat}"'
  18.                 lng = '"${it.lng}"'
  19.             }
  20.         }
  21.  
  22.         broadcaster['/atmosphere/recommend'].broadcast(jsonResult)
  23.     }
  24.        
  25. location = {
  26.     lat = it.lat
  27.     lng = it.lng
  28. }