On Nov 15, 9:49 am, vishal garg <[email protected]> wrote:
> Hi larry, what does asynchronous imply here?

What it means anywhere. The GDirections service sends a request to the
server.  It comes back sometime later and a callback function runs.

See this page from Mike Williams' v2 tutorial:
Javascript Concepts - Part 2 Asynchronous I/O
http://econym.org.uk/gmap/async.htm

While you are there look at his working v2 directions examples...

  -- Larry

> Meanwhile, the complete post is at :
>
> http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
>
> Just to avoid duplication of content!
>
> -vishal garg
>
> On Tue, Nov 15, 2011 at 10:32 PM, [email protected]
>
>
>
>
>
>
>
> <[email protected]> wrote:
> > On Nov 15, 8:37 am, vishal garg <[email protected]> wrote:
> >> I am using 'loadFromWaypoints' function of the GDirections object.
> >> There are multiple instances of the GDirections object in the code.
> >> Please note Gdirections object is defined in google maps api v2. E.g.
>
> >> dirn1.loadFromWaypoints([p11.toUrlValue(6),p11.toUrlValue(6)],
> >> {getPolyline:true});
> >> dirn2.loadFromWaypoints([p22.toUrlValue(6),p22.toUrlValue(6)],
> >> {getPolyline:true});
>
> >> But whenever I load the page, it stops before "dirn1..."
> >> And loads ultimately, when I add alert statements as :
>
> >> alert("0a");
> >> dirn1.loadFromWaypoints([p11.toUrlValue(6),p11.toUrlValue(6)],
> >> {getPolyline:true});
> >> alert("0b");
> >> dirn2.loadFromWaypoints([p22.toUrlValue(6),p22.toUrlValue(6)],
> >> {getPolyline:true});
> >> alert("oc");
> >> var p1 = dirn1.getPolyline().getVertex(0);
> >> alert("0d");
> >> var p2 = dirn2.getPolyline().getVertex(0);
>
> >> Could it be a problem that I am using deprecated API (google map api
> >> v2)?
>
> > No.
>
> >> If not what is the possible solution to load the page smoothly
> >> without using alert statements?
>
> > Where is your map that shows the problem?
> > [GDirection calls are asynchronous, you need to wait for them to
> > return the results before accessing them]
>
> >  -- Larry
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google Maps API V2" 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 
> > athttp://groups.google.com/group/google-maps-api?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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