0
我想顯示定製的卡(離子型卡),每當我點擊在谷歌地圖angularjs的標誌。
我設法調用infoWindow,但我不知道如何改變它的輸入來添加卡。
這裏是我的代碼:
var marker = new google.maps.Marker({
position: {
lat: markers[0].lat,
lng: markers[0].lng
},
map: this.map,
title: markers[0].title,
animation: google.maps.Animation.DROP,
icon: icon1
});
var infowindow = new google.maps.InfoWindow();
marker.content = 'marker.description';
marker.addListener('click', function() {
infowindow.setContent(marker.content);
infowindow.open(this.map, marker);
});
謝謝您的幫助。
將偵聽器添加到標記上而不是地圖上。有關文檔,請參閱https://developers.google.com/maps/documentation/javascript/examples/event-simple?hl=fr –
Thanx。 – Hana