Hi

Thanks 4 ut reply .

i have changed it into following

directionsAll[elem] = new GDirections();
 GEvent.addListener(directionsAll[elem],"load",function(){
 polyAll=directionsAll[elem].getPolyline(true);
 polyAll.color = "#ff0000";
 polyAll.opacity = 1;
 polyAll.weight = 2;
  if(polyAll){
    map.addOverlay(polyAll);
  }
});

start = markers[elem].getAttribute("address");
alert(elem);
var newI = elem+1;
if(newI < markers.length){
end = markers[newI].getAttribute("address");
//alert('location '+ i +' start '+ start + ' end '+ end);
directionsAll[elem].load("from:"+ start +", Kingston, ON to: "+ end
+", Kingston, ON",GDirectionsOptions);
}


But there's no luck 4 me . :(

can please please look into this issue?



On Mar 5, 3:30 pm, Andrew Leach <[email protected]> wrote:
> On Mar 5, 10:20 am, jey jey <[email protected]> wrote:
>
> > I am using the above code to display the directions  based on the
> > values loaded from the xml file. they are in array called markers. But
> > while loading them its not displaying all location directions, few
> > direction are missed out. Could please help me to find the issue
> > behind this.
>
> You are re-using "directionsAll". One directions-load may not have
> completed before the loop goes round again and issues another request.
>
> From the documentation; "If a previous load() request has not
> completed when a new call to load() is invoked, the previous request
> is cancelled. Thus, you can use a single GDirections object to issue
> directions requests serially, but to generate multiple requests in
> parallel, you must use multiple GDirections objects."
>
> Andrew
--~--~---------~--~----~------------~-------~--~----~
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