0
我“米试图重新计算自动运行的收集更新, 我只设法得到它时,添加以下代码autopublish.the作品完美地工作。跟踪器自动运行
Tracker.autorun(function() {
var pages = Posts.find().fetch();
_.each(pages, function(page) {
console.log("react");
if (typeof page.adress !== 'undefined' &&
typeof page.lat !== 'undefined' &&
typeof page.long !== 'undefined') {
var objMarker = {
id: page._id,
lat: page.lat,
lng: page.long,
title: page.name
};
// check if marker already exists
if (!gmaps.markerExists('id', objMarker.id))
gmaps.addMarker(objMarker);
}
});
});
}
我需要的是对认购反应 我对本出版物中定义:
Meteor.publish('allposts', function() {
回报Posts.find({}); });
完美谢谢你的男人 – Genjuro