【发布时间】:2015-06-24 04:00:34
【问题描述】:
我刚刚开始创建一个 Meteor 应用程序并添加了 dburles:google-maps 包,我似乎一直按照他在如何实现它的教程中指示的步骤进行操作,但我收到错误 Template not defined,我的代码如下如下:
.html
<head>
<meta charset="utf-8">
<title>project-j</title>
<meta name="description" content="Let's see where it takes us">
<meta name="viewport" content="user-scalable=no, initial-scale=1, minimal-ui, maximum-scale=1, minimum-scale=1" />
</head>
<body>
{{> map}}
</body>
<template name="map">
<div class="map-container">
{{> googleMap name="map" options=mapOptions}}
</div>
</template>
.js
Meteor.startup(function() {
GoogleMaps.load();
});
Template.map.helpers({
mapOptions: function() {
if (GoogleMaps.loaded()) {
return {
center: new google.maps.LatLng(-37.8136, 144.9631),
zoom: 8
};
}
}
});
任何想法,我检查了完成的 repo,代码似乎与我的代码是 1:1...?
【问题讨论】:
标签: javascript meteor