hello all
i am trying to locate the distance between a single cutomer and all
the branches, this is the code i have tried but it gives the same
result with every branch eventhough the function gdir.load is called
every time in the loop (called from setDirections fucntion).
and below is a snippit i hope it shows what i mean , and this code is
fired when a button is pressed,and the weired thing when i press the
button is that all of the values of distances are of the same
value,until i click the button again, the values gets changed..
var distances = new Array(branch_postcode.length);
for (var i =0;i <branch_postcode.length; i++ )
{
gdir.clear() ;
setDirections(customer_postcode, branch_postcode[i], "en_US");
distances[i] = gdir.getDistance();
}
alert(distances[0].meters + " , "+distances[1].meters+" ,
"+distances[2].meters);
}
--
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.