2017-03-16 8 views
0

このメテオコードは、Googleマップに10個のマーカーを配置する必要があります。マーカーは、mongoコレクション文書のアドレスプロパティの最初の10個所に一致する必要があります。
住所はformateにあります "55 abc St. Sydney 2000" 私はそれを行う方法がわかりません。助言がありますか? THXモンゴーのマーカーをdburlesを使って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> 

答えて

0

それがこのnpmモジュールを搭載したこの男hereのために働いていた方法をチェックアウト。

ここでは、add markersの方法と、geocodingを使用して住所を経度と緯度に変換する方法について説明します。

関連する問題