> ...causes a failure in creating the markers. What I need is a way of > making sure the addListener refers to each marker not just the last > one. How do I do that? Ideas, anyone?
Go back to Mike's tutorial. Use your browser 'view source' in the given example, perhaps you missed the link in "Here's a simple example". It's not that the API commands used are any different, it is the way it is structured in a function that makes it work. Move your GMarker creation and listener-adding code into a function that you call from your XML parsing code for each marker, passing data to it. This will ensure you get function closure. It's not an easy concept to grasp. Another XML based example http://econym.org.uk/gmap/basic3.htm -- 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.
