On May 28, 8:49 am, "[email protected]"
<[email protected]> wrote:
> > Add a listener for the load event of your directions object; in the
> > handler function, change the second map. Assuming you have one route,
> > centre your second map at
> >   gdir.getRoutes(0).getEndLatLng()
>
> Well, i am not a pro in java-programming...

That's OK, the Google Maps API doesn't involve java programming.  It
is javascript.

>
> I tried this code:

...

>
> But is doesn´t work. If I change " end.setCenter(gdir.getRoutes
> (0).getEndLatLng(), 10); "
> to "end.setCenter(new GLatLng(5.289191,4.568451), 10);" the second map
> is shown correct....
>
> So, what have I to change?
GDirections is asynchronous.
from Mike Williams' tutorial:
Javascript Concepts: Part 2 Asynchronous I/O
http://econym.org.uk/gmap/async.htm

Please follow the posting guidelines:
http://groups.google.com/group/Google-Maps-API/web/suggested-posting-guidelines
http://groups.google.com/group/Google-Maps-API/web/why-including-a-link-is-critical

  -- Larry
--~--~---------~--~----~------------~-------~--~----~
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