On Sep 2, 5:26 pm, JohnPru <[EMAIL PROTECTED]> wrote:
> I am trying to use the code below which works fine but I need to pass
> just the actual distance i.e. "8.3" to a php variable so I can use it
> to charge for delivery on a price per mile basis, I do not want
> anything written to the screen!
Instead of using dirn.getDistance().html to get the distance, use
dirn.getDistance().meters. Note the spelling. That returns just a
number, which you can convert to miles if you need to.
You can then use GDownloadUrl() to pass that number to a server
script.
var dist = dirn.getDistance().meters;
GDownloadUrl("myscript.php?distance="+dist,callbackFunction);
The callback function could do nothing or could process any output
from the php script.
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
-~----------~----~----~----~------~----~------~--~---