----- CODE SNIPPET -----
var j=0;
var k=1;
var myroutes = new Array();
for (j=0;j<=1;j++) {
myroutes[j] = eval("route" + k);
k++;
}
imax = myroutes.length-1;
var rides = new Array();
for (r=0;r<=imax;r++) {
rides[r] = new GDirections();
rides[r].loadFromWaypoints(myroutes[r], {getPolyline: true});
GEvent.addListener(rides[r], "load", function(){
var poly = rides[r].getPolyline();
map.addOverlay(poly);
});
alert(r);
}
-------------------------
I think this is how you're supposed to use arrays to store this kind
of information but I get no lines loading and firebug gives me teh
error:
rides[r] is undefined
var poly = rides[r].getPolyline();
What does that error actually mean? And is the code even right to
start with?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---