> function setDirections(fromAddress, toAddress1, toAddress2, locale) {
> gdir.load("from: " + fromAddress + " to: " + toAddress1 + " to: " +
> toAddress2,
> { "locale": locale });

Have a think about what this is doing.
You are defining your function with four parameters - three addresses
and a locale.
What happens with two addresses?  What happens if you want four
addresses?  What happens if one of the given addresses is just blank?

I think I'd start by rearranging to
   function setDirections(locale, fromAddress, toAddress1,
toAddress2, ....
so that you can now define as many addresses as you like without it
affecting 'locale'
You'd need to change every place that you call your new function, so
that the parameters are given in the new order.

Then you'd write code to check if each address was not blank, and only
add it and it's accompanying "to:" if it had content.

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