> I guess it's because the geocoder request is async

Yes.  The callback function that you define is run by the browser when
the results come back from Google.  You cannot return data from a
callback function because there is no calling javascript to return it
to.  If you want to do something with those results, you need to do it
within your callback function.

You can extend your callback function to test if both markers have yet
been placed, and if so carry on with a Directions request

-- 
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.

Reply via email to