I have a piece of javascript code where I create markers and attach InfoWindows to them, like this:
for (var i = 0; i < 8; i++) {
var marker = new goo
Try this:
// Create a marker for each place.
marker = new google.maps.Marker({
map: map,
icon: icon,
title: place.name,
animation: google.maps.Animation.DROP,
position: place.geometry.location
});
var infowindow = new google.maps.InfoWindow({
content:'' + place.name + '
' +
'Place ID: ' + place.place_id + '
' +
place.formatted_address + ''
});
marker.addListener('click', function() {
infowindow.open(map, this);
});
Thank you