Here is my code:
for(var i = 0; i < this.events.length; i++)
{
this.markers.push((this.map.addMarker(
{
position: new GoogleMapsLatLng(this.data[i].lat, this.data[i].lng)
}).then( () => {
this.markers[i].addEventListener(GoogleMapsEvent.MARKER_CLICK, () => {alert("ok");});
})));
}
However, nothing happens upon the click. Any idea why?