You've got three different variables called "marker". One is global. It never gets assigned a value. You only use it in your marker.infoWindowClose() call.
One is local to the callback function of your GDownloadUrl callback function. This one ends up being a reference to the last marker fetched. One is local to your createMarker() function, which holds Function Closure on it and makes it available to your "click" callback function. Wouldn't it be nice if your "click" callback function could pass the marker reference to your remData() function. Unfortunately that can't happen directly. There's two ways to get the marker reference to remData(). One way is to create a global array of markers and pass the index. var gmarkers = [] // global Then in createMarker(): gmarkers[id] = marker; Then in remData(): var marker = gmarkers[id] The other way is to note the fact that there can only be one infowindow. So the marker with the window open when you reach remData() must be the last marker that had a click, so you could write: var lastmarker; // global Then in createMarker(): lastmarker = marker; Then in remData: var marker = lastmarker; -- http://econym.org.uk/gmap The Blackpool Community Church Javascript Team --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
