I\'m currently using the following code the place multiple markers on a Google Map using their API.
The problem I\'m having is with multiple infowindows not working
var infowindow = null;
infowindow = new google.maps.InfoWindow({
content: "loading..."
});
for (i = 0; i < data.dbreturn.length; i++) {
var latilongi = data.dbreturn[i].mapa.split(',');
var mapinha = {lat: parseFloat(latilongi['0']), lng: parseFloat(latilongi['1'])};
var marker = new google.maps.Marker({
position: mapinha,
html: ''+data.dbreturn[i].nome+'
'
});
google.maps.event.addListener(marker, "click", function () {
infowindow.setContent(this.html);
infowindow.open(map, this);
});
}