我使用带有邮政编码(PO BOX)的 Gmap 并想添加门牌号以获得更完美的标记,如何添加门牌号?这是我的代码:
function createMap() {
geocoder = new google.maps.Geocoder();
var mapOptions = {
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
var address = '8915 CK, NL';
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}