Hi, I'm trying to add info windows to each marker that I add from an array, 
for the life of me I can not figure this out, I'm sure I'm doing something 
stupid, I'm not the most knowledgeable javascript user. My map will not even 
load when i put the infowindow code into it, but without it it works 
perfectly. I'm 98% sure its a problem with the eventListener but i just cant 
figure it out.

   
    while (j < latArray.length)

    {

    var myLatLng = new google.maps.LatLng(latArray[j], lonArray[j]);

    var marker = new google.maps.Marker({position: myLatLng, map: map, 
animation: google.maps.Animation.DROP});

   markersArray.push(marker);

   var infowindow = new google.maps.InfoWindow({content: "<b>Species: </b>
<i>" +  speciesArray[j] + "</i><br>"+ picArray[j] + "<br>                   
             <b>Description: </b>" + descriptArray[j] + "<br><br><b>Lat/Long: 
</b>" + myLatLng, position: myLatLng  

          }); 

   google.maps.event.addListener(marker, 'click', function(event)

     {

               infowindow.open(map, myLatLng);

    }  

     j++;

    }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to