sam. 21 juillet 2018, 12h47
eddymaue
atoutfox.public.association
Re: calcul de distance entre 2 points gps
Allo Mike
ca ne fonctionne pas
<?xml version="1.0" encoding="UTF-8"?>
<DistanceMatrixResponse>
<status>OK</status>
<origin_address>Quebec, Canada</origin_address>
<destination_address>Montreal, QC, Canada</destination_address>
<row>
<element>
<status>ZERO_RESULTS</status>
</element>
</row>
</DistanceMatrixResponse>
? GetDistanceOnly('Quebec','Montreal')
Procedure GetDistanceOnly(tcFrom,tcTo)
* 01/19/18 - Gmap Key.
Set Step On
Local xhrRequest,;
oXml As XMLAdapter,;
lGagnon
lGagnon = .T.
If lGagnon
gMap_Key = 'AIzaSyBUxfORDrYgYayX62_y0eXIHxQ8p2m1fOE'
Else
gMap_Key = Alltrim(Local.gMap_Key)
Endif
xhrRequest = Createobject( "Microsoft.XMLHTTP" )
sQuery ='
https://maps.googleapis.com/maps/api/distancematrix/xml?units=imperial&origins=[tcFrom]&destinations=[tcTo]&key=cGMap_Key'
sQuery = Strtran(sQuery,'[tcFrom]',tcFrom)
sQuery = Strtran(sQuery,'[tcTo]',tcTo)
sQuery = Strtran(sQuery,'cGMap_Key',gMap_Key)
xhrRequest.Open ("GET", sQuery, .F.)
xhrRequest.Send()
oXml = Null
oXml=Createobject('msxml.domdocument')
oXml.LoadXML(xhrRequest.ResponseText)
Return oXml
--
a+ Eddy
Merci de partager avec moi votre immense savoir que je me ferai plaisir
d'absorber... il va de soi que je vais vous en laisser un peu
Politesse et savoir vivre oblige ;0)
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019138