On Aug 17, 1:53 pm, Frank Post <[email protected]> wrote:
> Hello,
>
> I'm using a couple methods I found on Mike's website. These include
> elabels and invisible gmarkers. I'm not sure if I combined it all the
> way it should. I've got a problem getting the event listener for the
> invisible markers to work together with the directions which should
> show in the info windows. When I click on an item in the sidebar the
> info window shows correct as it should be, but unfortunately they
> don't for the markers on the map. Can somebody please help me to
> figure out what I'm doing wrong here, and if I combined everything the
> way it should be. I'm not sure about the loop part which get's the
> data from my XML, and the whole invisible markers setup. Do I need to
> duplicate the whole directions function to the evenlistener of the
> invisible markers!?
I don't know about "invisible markers", but the reason your
infowindows appear differently when the marker is clicked on vs. the
sidebar is that different code is running.
sidebar click runs myclick function which does this:
gmarkers[i].openInfoWindowHtml('<div class="infowin">' + htmls[i] +
'</div>');
marker click runs this code:
gmarkers[i] = marker; <-------------- this looks really bad,
overwrites an element of the gmarkers array (luckily probably the one
after the end of the array, but still...)
htmls[i] = html; <-------------- same here
gmarkers[i].openInfoWindowHtml('<div class="infowin">' + htmls[i] +
'</div>');
I would suggest making one version, defined in the marker click event
handler, then changing myclick to trigger the marker click
lilke this:
function myclick(i) {
GEvent.trigger(gmarkers[i], "click");
}
-- Larry
> It seems I need to re-set all values, even they are already set at the
> top of the script
>
> site URL:http://usccm.nl/test2.php
>
> thank you in advance
>
> kind regards
> Frank
--
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.