Getting Mileage Data from Google Maps
Bill Marriott
wjm at wjm.org
Sun Jun 25 14:56:19 EDT 2006
Without having even tried this kind of magic, I will say "yes!"
There's two ways you would go about it:
1) An API. Google has APIs for just about everything, so if you scrounge
around in their developer area a bit I'm sure you'll find one for Google
maps. Actually, I found this bit on
http://www.google.com/apis/maps/documentation/
The Google Maps API does not include routing services at this time. However,
there are a number of free routing APIs on the web. If you would like to add
local search capabilities to your site, you can use the Google AJAX Search
API to embed a local search module into your site.
The "free routing API" sounds like something you might want.
http://www.google.com/search?q=free+routing+api
Looks like MapQuest has one.
2) Parsing the HTML. If you can construct the proper URL with parameters,
you would get back a page with the HTML for the directions and whatnot.
Google maps always says something like "Distance: 12.6m (about 15 mins)" on
that page. And that text appears nowhere else. So, if you can coax a valid
result out of Google or any other mapping system, you could try to find that
text in the soup of JavaScript and style sheets and whatnot that is
returned.
All things equal, I'd investigate #1 first.
Jim Carwardine wrote:
> I'm looking at developing a stack that can take two destinations, my
> office
> and the address on my receipt, give them to a service like Google Maps and
> get the distance between the locations. Is there a way to do this using
> Rev? Jim
More information about the use-livecode
mailing list