On Apr 26, 11:53 pm, wsrphoto <[email protected]> wrote:

> for (var i = 0; i < markers.length; i++) {
> var lat = markers[i].getAttribute("lat");
> var lng = markers[i].getAttribute("lng");
> var polyline =new GPolyline([
> new GLatLng(lat, lng)
> ],"#0000ff", 1);
> map.addOverlay(polyline);

Think about what your loop is doing. For each element in the "markers"
array, you create variables holding the latitude and longitude,
another one called "polyline" which contains a single-element array of
one point and then add that line to the map. Then you go on to the
next point.

You need to start out with an empty array, push each point on to it in
turn, and then (once the loop is finished), create a polyline from
that array and add it to the map.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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