Wonderful !!
Shame on me, I should have been using a javascript debugger. Now the script
works and can even tell whether the visitor was wrong about the origin
address, the destination address or if the driving distance can not be
calculated, you can try it. I'll post it asap for the community. However
let's notice that my script couldn't distinguish origin or destination
mistakes with multiple addresses.
About your latest remark, I do have to display the returned
origin/destination address to ask my customers to confirm them, but I'd
rather avoid that as the form is quite heavy so far.
Thank you very much for your help. Best regards.

2011/5/16 Enoch Lau <[email protected]>

> If I make a request from France to aksdhlaksdhjasd using your script, it
> throws an exception line 56: var dist = element.distance.value;
> This is because you should check the status of the element (which is
> NOT_FOUND) before you request the distance, which you're currently not
> doing.
>
> You are currently testing the returned origin and destination addresses
> against the empty string to determine whether a particular address was
> understood or not; instead, you should examine the status of the
> corresponding element - if it is NOT_FOUND, then it means that either of the
> origin or destination for that element was not understood.
>
> If you are concerned that your customers may be entering in addresses that
> are then interpreted to be something other than what they intended, would it
> be possible for you to display the returned origin/destination address and
> confirm with them that that is in fact what they wanted?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to