【发布时间】:2015-08-26 18:11:00
【问题描述】:
我正在尝试建立一个房屋租赁网站并为每个列表实施谷歌地图标记。我已经存储了集合中每所房子的纬度、经度及其标题。
但我无法在助手端调用 {{olat}},因为我可以在视图模板上充当每个占位符。如何在下面给出的助手中调用集合数据。
Template.listing.rendered = function() {
var tmpl = this;
VazcoMaps.init({}, function() {
tmpl.mapEngine = VazcoMaps.gMaps();
tmpl.newMap2.addMarker({
lat: 28.6508, //replace this with lat,long variable stored in collection
lng: 77.3152, //for each listing
zoom: 11
icon: '/images/mark.png',
draggable: false
});
});
};
【问题讨论】:
标签: javascript meteor meteor-helper