Google maps - getting directions

Ken Ray kray at sonsothunder.com
Thu Feb 15 11:48:28 EST 2007


On Thu, 15 Feb 2007 07:56:10 -0800, Robert Eppich wrote:

> Good Morning to you from Vancouver BC,
> 
> Anyone have a way to use Rev to supply the addresses to Google map 
> directions?
> 
> It would be cool if it were possible to supply the start address and 
> the stop address to Google map and get the map and driving directions 
> from the Google website.
> 
> Is it possible to do this  from the message box, any examples?

Well, here's a head start - this will give you the HTML from the page, 
from which you can parse out your results:

on mouseUp
  -- uses two random points in my town
  put "1230 Main Street, Eau Claire, WI 54701" into tStart
  put "1428 Glenn Place, Eau Claire, WI 54703" into tDest
  put urlEncode(tStart) into tStart
  put urlEncode(tDest) into tDest
  put url ("http://maps.google.com/maps?f=d&hl=en&saddr=" & tStart & 
"&daddr=" & tDest) into tResult
  -- parse the data in "tResult" here
end mouseUp

Alternately, you can change it a bit so that you get the browser to 
open and show it:

  revGoURL ("http://maps.google.com/maps?f=d&hl=en&saddr=" & tStart & 
"&daddr=" & tDest)

HTH,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list