On Sep 23, 10:56 am, Leigh <[email protected]> wrote: > Hi all, > > I know that everyone like to work with existing code rather than vague > questions, so I'll start with the very simple version of this > question. Can anyone help me understand why this works (displays 2 > routes): > > http://www.routeloops.com/Working/dontUseIndex.html > > but this does not (displays no routes): > > http://www.routeloops.com/Working/useIndex.html
I get a javascript error, don't you? I don't have a real debugger, but I suspect that it is complaining that directionsDisplay[2] doesn't exist when the call back runs. -- Larry > > ? > > There is almost no difference between the two. I am creating two > DirectionsService and DirectionsRenderer objects, and trying to > display them on this map. (Yes, I stole this map from someone else -- > you all may have seen it before.) In both cases I have a loop over j > from 0 to 1 to create the route and display it. In the case that > works, I use 0 and 1 as the explicit indices. In the case that does > not work, I use j as the index. I can't figure out why those two > should be different, but it appears they are. Can anyone explain to > me why that is? > > (What follows is a longer description of what I'd like to eventually > achieve, of which the above is only a part. Don't read it if you > don't care.) > I have a web application called routeloops.com which automatically > generates closed route maps. (For biking, running, etc.) Although it > is not built on Google Maps, I would like to provide a Google Maps > interface to it. To do that, I will need to take a set of LatLng() > and route between them (from 0 to 1, 1 to 2, 2 to 3, etc, all the way > back to 0.) I have been struggling with how to get Google Maps to do > this properly, and still leave the route draggable (which is another > thing I want.) I am hoping that what I am doing above is a step in > the right direction, but I'm stumped by why I can't simply loop over > these functions and get them to work. > So if, in addition to the above specific question, anyone has any > thoughts/examples on how to accomplish my eventual goal (without using > the waypoint functionality -- which I do know how to do, but which is > too limited for me) then I would VERY MUCH appreciate that as well. > > Leigh -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
