Path: csiph.com!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Google Maps Functions Integration Date: Thu, 31 Oct 2013 13:45:47 +0100 Lines: 48 Message-ID: References: <99e97844-dbf7-4108-92bb-9c66248018c2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: individual.net vjbFcgrnQXwUhxd9T34WewSs/ue8R490b0BhggqQdips14PJw= Cancel-Lock: sha1:QOJv8w3pGEzcgqMiS9LVzdKpjSY= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:6182 Hi Paul, > Is there a google maps function to calculate driving distances > between 2 places (United Kingdom) and can it be accessed from within > a VO 2.8 application. > > I know i can calculate the distances if i go on the google maps > webpage and key it in manually (for mileage expenses) but because i > have many journeys to input it would save me a lot of time if i could > automate this from within the application. this is very easy, but limited if you don't like to pay for it. Please read Google's terms about a commercial use of the map functions. You can send a http request to Google's servers and they will return an XML file with the requested information: This is the code I'm using: cHostName := "maps.google.it" cURL := ParmSubst( "maps/api/directions/xml?origin=%1&destination=%2&sensor=false", self:_FixAdresse( _cStartAdresse ), self:_FixAdresse( _cZielAdresse ) ) oHttp := clsHttpComm{ cHostName } oHttp:ServerName := cHostName while ( _nLastCall + 0.30 ) >= Seconds() Sleep( 300 ) debOut( "Sleeping 300 milli-seconds" ) end _cXMLResult := oHttp:GetResult( cURL ) if oHttp:Error return false endif You need to pass in the adress in the format Google Maps likes - try on their Maps page. HTH Wolfgang --