load multiple directions in parallel in google map

Posted by Maneesh on Stack Overflow See other posts from Stack Overflow or by Maneesh
Published on 2010-05-11T09:30:52Z Indexed on 2010/05/11 9:34 UTC
Read the original article Hit count: 319

Filed under:

My aim is to get distance between many locations thru GDirection object. Since I am using multiple objects, am not able to get distnace. Can someone help me out. Below is the code.

      for(ct=0;ct<size;ct++)
    {
         var gd=new GDirections();

     gd.load("from: " + address + " to: " + offaddress[ct]);


     GEvent.addListener(directions,"load", function() {


     sor[ct]= gd.getDistance().html;    

     }

© Stack Overflow or respective owner

Related posts about google-maps