2017-05-31 83 views

回答

1

這就是如何添加標記給你的地圖。小心你需要先建立你的地圖。

addMarker() { 

// costum image 
//let image = 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'; 
let marker = new google.maps.Marker({ 
    map: this.map, 
    animation: google.maps.Animation.DROP, 
    position: this.map.getCenter() 
    //,icon: image 
}); 

let content = "<h4>Information!</h4>"; 

this.addInfoWindow(marker, content); 

}