-
-
Save easierbycode/2731426 to your computer and use it in GitHub Desktop.
MapBlips abridged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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