Using FireBug, I just watched what happens on the Maps Directions demo page ( http://code.google.com/apis/maps/documentation/examples/directions-simple.html ) which makes a request to:
http://maps.google.com/maps/nav?key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&output=js&doflg=ptj&q=from%3A%20500%20Memorial%20Drive%2C%20Cambridge%2C%20MA%20to%3A%204%20Yawkey%20Way%2C%20Boston%2C%20MA%2002215%20(Fenway%20Park)&callback=_xdc_._0fl8a133u Which looks like it returns a JSON representation of the driving directions. It looks like the URL format is: http://maps.google.com/maps/nav?key<key>&q=<query> For example: http://maps.google.com/maps/nav?key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&q=from:New+York+to:+Boston which you can see has the JSON encoding and the following data: "Distance":{"meters":346431,"html":"215 mi"} So, its 346.431 km, or 215 miles. (NB: Its interesting how meters are much more accurate than non-decimal "miles") I also tried this with my own key on my own domain, and it worked. The example above uses the key from Google, so beware of cut-and-paste issues. Steve On Sep 14, 9:30 am, jordan <[EMAIL PROTECTED]> wrote: > I hear they're working on it... I'm waiting for this to > > On Sep 7, 5:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > I am trying to do several things with google maps via PHP. > > > I have managed to request lat and long via aURLcall and work with > > the results in PHP. > > > Now I would like to get a distance between 2 adresses and use it in > > PHP. Is there a way to call the maps API via aURLcall and receive > > the distance so I can continue to work with it in the PHP code? > > > Thanks a lot and cheers, > > Thomas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
