This Meteor code needs to place 10 markers on google map, the markers need to match the first 10 locations in the address property of a mongo collection document.
The addresses are in the formate "55 abc St. Sydney 2000"
I am not sure how to do it. Any suggestions? thx
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>