0
此流星代码需要在google地图上放置10个标记,标记需要与mongo收集文档的地址属性中的前10个位置相匹配。
地址在“55 abc St. Sydney 2000” 我不知道该怎么做。有什么建议么? THX使用dburles将标记从mongo放到google地图上:google-maps
Template.gmap.helpers({
mapOptions: function() {
if (GoogleMaps.loaded()) {
return {
center: new google.maps.LatLng(-37.8136, 144.9631),
zoom: 13
};
}
}
});
Template.gmap.onRendered(function() {
GoogleMaps.load();
});
Template.gmap.onCreated(function() {
GoogleMaps.ready('map', function (map) {
var marker = new google.maps.Marker({
position: map.options.center,
map: map.instance
});
//Access a map instance any time by using the maps object.
// GoogleMaps.maps.exampleMap.instance
});
});
<template name="gmap">
<div class="map-container">
{{> googleMap name="map" options=mapOptions}}
</div>
</template>