Skip to content

Instantly share code, notes, and snippets.

@Pent
Created November 21, 2013 01:17
Show Gist options
  • Select an option

  • Save Pent/7574367 to your computer and use it in GitHub Desktop.

Select an option

Save Pent/7574367 to your computer and use it in GitHub Desktop.
reactive map markers
Meteor.subscribe("markers");
//will, in theory, run everytime Markers.find() changes
Deps.autorun(function() {
console.log("grabbed " + Markers.find().count() + " markers");
Markers.find().forEach(function (marker) {
var geoJSON = { type: "FeatureCollection", features: [ marker ]};
L.mapbox.markerLayer(geoJSON, {
detectRetina: true,
}).addTo(map);
console.log("should be really done");
});
)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment