How to decorate marker in Google Maps


#1

Hi, I am trying to display the event name for each event location from a parsed JSON file. I am unsure how to do this and have only been able to display a simple string such as “test”. Right now with the code I have it shows a blank info window and I am unsure why. Any help is appreciated on how to display the eventName for each event. Thanks!

My marker/info window functionality:

getMarkers(){
this.http.get('http://app.toronto.ca/cc_sr_v1_app/data/edc_eventcal_APR?limit=500').map((res)=>res.json()).subscribe(data=>{
this.addMarkersMap(data);
  });

}

addMarkersMap(markers){
for(let marker of markers)
 {
var loc = marker.calEvent.locations[0]['coords'];

  console.log(loc);

  
  marker = new google.maps.Marker({
   position: loc,
  map: this.map,
  
    });


  var infoWindow = new google.maps.InfoWindow({
   content: markers.eventName
  
}); 

google.maps.event.addListener(marker, 'click', function () {
  infoWindow.open(this.map, marker);
 });

}
}