0

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>
Fred J.
  • 5,759
  • 10
  • 57
  • 106

1 Answers1

0

Checkout how it worked for this guy here with this npm module.

Here's the documentation for how you can add markers, as well as use geocoding to turn addresses into longitude and latitude.

Community
  • 1
  • 1
mutdmour
  • 543
  • 5
  • 14