On Jul 13, 7:42 pm, Mike <[email protected]> wrote:
> Hi,
>
> I have a map with multiple markers loading from XML.
>
> The markers load properly, but no matter which marker I click, the
> same bubble pops up on the same marker.

You aren't getting function closure on the markers.
Pitfall number 3 on Mike Williams' (v2) Tutorial:
The Basics - Part 1 Markers with info windows
http://econym.org.uk/gmap/basic1.htm

>
> Here is my loop:
> =====================
>
>       var markers =
> data.documentElement.getElementsByTagName("marker");
>       for (var i = 0; i < markers.length; i++)
>       {
>         var bubbletext = "<p>"+ markers[i].getAttribute("club") +" ::
> "+ markers[i].getAttribute("stat") +"</p>";
>         var latlng = new
> google.maps.LatLng(parseFloat(markers[i].getAttribute("lat")),parseFloat(ma­rkers[i].getAttribute("lng")));
>         var infowindow = new google.maps.InfoWindow({content:
> bubbletext});
>         var marker = new google.maps.Marker({position: latlng, map:
> map});
>         google.maps.event.addListener(
>         marker, "click", function() {
>                 infowindow.open(map, marker);
>         });
>        }
>      });
>
> =====================
>
> Any help would be appreciated.

Does this help:
http://www.geocodezip.com/v3_MW_example_map3.html

  -- Larry


> Thanks, Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to