Here is a link to the same question.
但是,我想使用Google Geocode回答这个问题。有人可以使用Meteor和Blaze为我提供执行以下操作的代码。
非常感谢!
The Geocoder从文本字符串获取您的位置,现在您必须将此位置信息传递给您的位置功能。我已经将Google Places代码包装在一个函数中,并从geocoder对其进行了调用。
var address = '12 Crest View Ct';
geocoder.geocode({'address': address},
function(results, status) {
if(status == google.maps.GeocoderStatus.OK){
loc = results[0].geometry.location;
var bounds = new google.maps.LatLngBounds();
document.write(bounds.extend(results[0].geometry.location));
map.fitBounds(bounds);
new google.maps.Marker({
position:results[0].geometry.location,
map: map
});
place(loc); //here is the function call
}
}
);