It's because GDownloadUrl is asynchronous: http://econym.googlepages.com/async.htm
By the time you try to create the polyline, the points are not yet in the array. Move these two line inside the callback function,at the end of the loop: var rtPoly = new GPolyline(rtPoints,"#0000FF",3); map.addOverlay(rtPoly); and by the way, you can do rtPoints.push (point) since you have already read the XML and created the GLatLng object for the marker. -- Marcelo - http://maps.forum.nu -- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
