I've recently finished converting a map to work in v3. Its here:
http://julieshad.com/ag/map_v3.html. And the xml is here:
http://julieshad.com/ag/markers.xml.
I now have another hurdle to cross involving connecting/displaying a
relationship between some of the markers via data that is in the xml.
When the user clicks on a marker and an infowindow pops up, I want to
have a link inside the infowindow so when the user clicks on the link,
a specific marker's infowindow is opened in addition to one the user
has already chosen to open. I've seen some posts and examples that
touch on this subject, but after trying several methods unsuccesfully,
I thought I'd ask the experts.
The concept I thought would work would be to push the markers and
associated attributes (from xml file) as I generate them into an
array, so I could have marker[1], marker[2], marker[3] and so on. In
the xml data, I would connect markers through an attribute. So, if I
want marker[1] to have a link inside the infowindow that opens
marker[3]'s infowindow in addition, I would simply add an attribute in
marker[1]'s data that has marker[3]. Then, I could include in the
link a function that opens the associated marker, like:
function openNewLoc() {
GEvent.trigger(marker[1],"click");
}
Of course, marker[1] would be a variable (i.e. connected_marker)
that's an attribute of the marker, derived from the xml...like:
function openNewLoc() {
GEvent.trigger(connected_marker,"click");
}
But I'm not sure if I'm way off, or on the right track. And how do I
implement something like this? I know the syntax for pushing elements
into an array, but I've been unsuccessful trying it in the confines of
the map I'm using.
Thanks so much for your time, and I'll gladly clarify any points that
are confusing,