Gmaps将标记与邮政编码和门牌号码放在一起

时间:2013-05-12 19:53:40

标签: google-maps

我使用带邮政编码(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);
  }
});






}

0 个答案:

没有答案