0

UPDATED私はGoogleマップのangularjsでマーカーをクリックしたときに、カスタマイズされたカード(イオンカード)を表示したいディスプレイカードマーカーをクリックすると、Googleマップ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); 
}); 

はあなたの助けをいただき、ありがとうございます。

+0

マップの代わりにマーカーにリスナーを追加します。 docの場合はhttps://developers.google.com/maps/documentation/javascript/examples/event-simple?hl=fr –

+0

Thanxをご覧ください。 – Hana

答えて

-1

はその

google.maps.event.addListener(marker, 'click', function() { 
    infowindow.setContent(marker.content); 
    infowindow.open(map, marker); 
}); 

ようなもので試してみて、これが動作しない場合は、問題を示していMinimal, Complete, and Verifiable example提供(あなたがとにかく行う必要があります!)。

関連する問題