Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Forked from Chris-Murphy/gist:2394143
Created May 19, 2012 16:33
Show Gist options
  • Save easierbycode/2731426 to your computer and use it in GitHub Desktop.
Save easierbycode/2731426 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