On Sep 18, 6:23 am, pbmaps <[email protected]> wrote:
> I have combined the code from 2 of Mike Williams' tutorials -
> 'categories' and 'custom tooltips', and the result is mostly
> successful, except when I mouseover the markers, the same tooltip
> (relevant to just 1 marker) keeps appearing instead of a different
> tooltip for each marker.
>
> I suspect that, when merging the 2 sets of code, the above code
> stopped looping through the markers correctly and is stuck on the
> details for the last marker in the xml file. I'm sure the solution is
> simple, but I can't find it myself.
> Thanks in advance for any help you can give me.

You have fallen into Pitfall Number Three in having your marker
mouseover code outside a function closure. When a marker is moused-
over, the listener says "Show the tooltip for 'marker'" -- and at that
point 'marker' is the last one you processed.

If you put the mouseover code in the createMarker function, it will
work the same way as the click listener you already have there.

Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to