Hi, I do this:

var directions = new GDirections();
    GEvent.addListener(directions, 'load', function() {
...
}
  var temp=[];
  var tempb=[];

    for (i = 0; i < total; i ++)
    {

        var point = new GLatLng(old_points_lat[i],old_points_lng[i]);
        temp[i]=point.toUrlValue();
        if (i>0)
            {
                tempb[0]=temp[i-1];
                tempb[1]=temp[i];
                directions.loadFromWaypoints(temp,
{'getPolyline':true});
            }
    }

But I can see that when I call loadFromWaypoints into the loop then
don't go to the listener method. If I call loadFromWaypoints out of
the loop then works.

How I can use listeners in a loop?
Can any help me please?

--

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