Google maps 使用Meteor JS加载Google地图
使用Meteor 0.8.2和Google Maps API 3.0版 HTML文档:(我省略了我的谷歌地图键,但我有一个有效的) 我主要从网上找到的资源中获取样板代码。这些资源大部分都有一年的历史了,所以我想知道软件版本之间是否存在兼容性问题Google maps 使用Meteor JS加载Google地图,google-maps,meteor,Google Maps,Meteor,使用Meteor 0.8.2和Google Maps API 3.0版 HTML文档:(我省略了我的谷歌地图键,但我有一个有效的) 我主要从网上找到的资源中获取样板代码。这些资源大部分都有一年的历史了,所以我想知道软件版本之间是否存在兼容性问题 我想知道如何使用上面的代码加载地图。将html元素添加到hello模板: <div id="map-canvas" style="height: 300px; width: 300px"></div> 这段代码早在Meteor使
我想知道如何使用上面的代码加载地图。将html元素添加到hello模板:
<div id="map-canvas" style="height: 300px; width: 300px"></div>
这段代码早在Meteor使用渲染回调时就可以工作,因此没有任何更改
所有的代码都可以在页面上找到,关于这个主题已经有一些问题了,包括meteor特有的。我不理解这个问题。我在你的代码中没有看到任何加载地图的尝试?如果你正在寻找谷歌地图api的教程,那么我相信你能找到。如果与问题无关,你为什么给我们看流星锅炉板代码?
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "Welcome to myapp.";
};
Template.hello.events({
'click input': function () {
// template data, if any, is available in 'this'
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
<div id="map-canvas" style="height: 300px; width: 300px"></div>
Template.hello.rendered = function () {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8
};
var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
};