Created
November 21, 2013 01:17
-
-
Save Pent/7574367 to your computer and use it in GitHub Desktop.
reactive map markers
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
| 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