Is this just to be used in a PHP script? Will the server have the to and from addresses then? Those won't come from input at all?
What is the xml or json needed for? If it is just the miles then what else would go in the xml or json? It seems like you just have one piece of info. :)
Getting this clarified will help to know the best solution. Although Google doesn't have an official way to get the info we still may need to be able to do it just from PHP. However if you are getting the addresses from the client then an AJAX method or form submission could be used to get the miles to your PHP script. The API would be used but then a form or AJAX script would send it to the server.
Let me know if you have a question about this.
bol
Main Topics
Browse All Topics





by: fiboPosted on 2008-07-08 at 23:24:27ID: 21960989
Searching in the main discussion group at http://groups.google.com/g roup/Googl e-Maps-API / , it seems there is no "pure php" solution. roup/Googl e-Maps-API /browse_th read/ threa d/ed6ca03d d601c663/b ce0a9c7fa3 fa0d2
port/bin/a nswer.py?a nswer=6684 8
see for example the thread
http://groups.google.com/g
So the solution seems to first get a javascript page (eg, php-generated), run it to get back driving directions (asyncrhonously), then pack everything into an array (eg, XML or JSON type) which is then handed back to another php script.
See also
http://code.google.com/sup