Hi, I've been looking for a solution here in the group but couldn't
find it. I also don't have a link for my application, but I think my
question is quite simple.
I just wanna load a route from database, but I don't want to simple
load the points array, like this:
GDir1.loadFromWaypoints(waypoints);
I want to load point by point, so like this I can keep a trail of all
polyline segments in the route, and I also can load as many points as
I want, not only 25.
The call would be like this:
GDir1.loadFromWaypoints([points[k], points[k+1]], {
getPolyline:true
});
I know that the load function is assycronous, so I created a trigger
event simulating a mouse click, since when I try loading it clicking
on the mouse for real, it works perfectly.
mark = new GMarker(points[0]);//Just to simulate that something is
being clicked
for(i = 0 ; i < points.lenght ; i++){
GEvent.trigger(map, "click", mark);
}
Like I said before, when I click for real its works, but when I
simulate the click event, it only loads the last point, like would
happen if I had done this:
for(k = 0 ; k < points.lenght-1 ; k++){
GDir1.loadFromWaypoints([points[k], points[k+1]], {
getPolyline:true
});
}
Any help? Does it have something to do with function closure? I've
read about on Mike's website, but could't really get it.
Thanks a lot,
Fernando Bião.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---