In creating markers on a page, I am looping thru a json result set
that is being AJAX'd in.  All data comes across fine, except the link
for each marker.  Every marker has ther link for the last object in
the array... I need a way to create this by ref, or something. Any
help would be greatly appreciated. Here's my code:

                    if(json.Status == 'OK')
                    {
                        widget.locations = new Array;
                        for(i = 0; i < json.Locations.length; i++)
                        {
                            var location = json.Locations[i].Location;
                            if(location.objid !=
widget.centerLocation.objid)
                            {
                                widget.locations.push(location);
                                var point = new GLatLng
(location.Latitude,location.Longitude);
                                var icon = new GIcon();
                                icon.image = '@AssetServerPrefix@/img/
default.png';
                                icon.shadow = '@AssetServerPrefix@/img/
shadow.png';
                                icon.iconSize = new GSize(31, 49);
                                        icon.shadowSize = new GSize(63, 53);
                                        icon.iconAnchor = new GPoint(31, 49);
                                        icon.infoWindowAnchor = new GPoint(20, 
20);
                                var marker = new GMarker(point,icon);
                                marker.objid = location.objid;
                                marker.idx = i;
                                widget.map.addOverlay(marker);
                                widget.loading.style.display = 'none';
                                GEvent.addListener(marker,
"mouseover",
                                function()
                                {
                                    var point =
widget.map.fromLatLngToDivPixel(this.getLatLng());
                                    widget.showDetails
(this.idx,point);
                                });
                                GEvent.addListener(marker, "mouseout",
                                function()
                                {
                                    widget.hideDetails()
                                });
                                GEvent.addListener(marker,"click",
                                    function()
                                    {
                                        document.location.href =
'http://@CityDomain@' + location.SeoUrl.toString();
                                    }
                                );
                            }
                        }
                    }

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