Skip to content

Instantly share code, notes, and snippets.

@Chris-Murphy
Created April 15, 2012 17:56
Show Gist options
  • Save Chris-Murphy/2394143 to your computer and use it in GitHub Desktop.
Save Chris-Murphy/2394143 to your computer and use it in GitHub Desktop.
MapBlips abridged
var Blips = new Meteor.Collection("blips");
if (Meteor.is_client) {
var handle = Meteor.subscribe('blips', function () {});
var handleClient = Meteor.subscribe('blips_' + clientID, function () {});
Meteor.call('mapBlips', box, clientID, function (error, result){
BlipsClient = new Meteor.Collection('blips_' + clientID);
blips_client = BlipsClient.find({});
}
if (Meteor.is_server) {
function mapBlips(box, clientID) {
Meteor.publish('blips_' + clientID, function (box) {
return Blips.find({"loc" : {"$within" : {"$box" : box}}});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment