I have a problem with google maps api v3 and markers with infowindow.
following part of code set markers, but its not possible to access the infowindows with click.
var infowindow = new google.maps.InfoWindow();
var marker, i;
function setMarker(){
for (i = 1; i < 240; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(line[i][0], line[i][1]),
map: map2
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent("Test");
infowindow.open(map,marker);
});
}
}
I hope someone can help me :)?