> GEvent.addListener(vmarker, "click", function() {
> for (var i=0; i<vmarkers.lenght; i++) {
> vmarker.openInfoWindowHtml("Représentations
> de"+vlabels[i]);
> }
> });
What that looks like its intended to do is - upon a click on ANY
marker, step through the whole array of vmarker and open each ones
infowindow. What you would see is just the last one, as there is only
one infowindow (opening it on another marker closes the previous one)
The loop wouldn't actually work though as vmarkers.lenght would be
undefined (spelling?).
It is important that you put the listener code in the code where you
build each marker (processing the villes XML)
In the code currently on your test page, it says
GEvent.addListener(vmarkers, ...
that won't work, vmarkers is a javascript array and never gets
clicked.
You want to attach the listener to each marker object, best to do this
where you create it
Outline -
Loop through XML reading 'ville' marker data
create individual marker
add listener to marker
push marker onto array
end loop
add array to markermanager
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en.