Hi All:

Thank you for reading the post.
First I want to get information from a XML, then use createMarker
function to put markers in map. it works fine. The problem is : in
createMarker function, if Newmarker is a local variable, in reOpenData
function, it will say that Newmarker is not defined. If i change
Newmarker into a Global Variable, for example, there are 4 points in
XML, i use a loop to read these 4 marker into map, after the loop, the
Newmarker will always point to the 4th marker.....No matter which
marker i click, the infowindow always point to the 4th one, but the
name which is displayed in infowindow is changed based on which marker
i click..

What i want to do is, first read markers from XML, and display in the
map(this part is Ok). Then when user click marker(say the first
marker). The first marker's infowindow will be displayed(if Newmarker
is local variable, this works fine), then i can click Modify button in
the infowindow. After click, the reOpenData should be performed. Hope
i make you all understand my problem.

Thanks in advance!
//----------------------------------------------------------
function createMarker(point,name) {
    var Newmarker = new GMarker(point,{draggable:true});

    GEvent.addListener(Newmarker, "click", function() {
           var html = "<table>" +
           "<tr><td>Name:</td> <td>"+ name + "</td> </tr>" +
           "<tr><td></td><td><input type='button' value='Modify?'
onclick='reOpenData()'/></td></tr>";
         Newmarker.openInfoWindowHtml(html);
                   });
         return Newmarker;
}
function reOpenData() {
        Newmarker.closeInfoWindow();
        var html2 = "......"
        Newmarker.openInfoWindowHtml(html2);
}
//----------------------------------------------------------------

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