Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Geolocation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01662773
Message ID:
01662783
Vues:
56
>
Procedure getGps(tcAddress,tcCity,tcState,tcZip,tcCountry)
>>	*+++++++++  *** Changed 2015/02/14 new way of getting GPS coordinates, more accurate ++++++++++++++++++++
>>	xhrRequest= Createobject("Msxml2.ServerXMLHTTP")
>>	sQuery = "http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=[tcCountry]&adminDistrict=[tcState]&locality=[tcCity]&postalCode=[tcZip]&addressLine=[tcAddress]&key=Ak3N0GxiMfdssziGDmDvJW3F0Zwo59dop-Q0st6eRNNmCw2Wuvn0RNb3EOg82WlR"
>>	sQuery = Strtran(sQuery,'[tcCountry]',tcCountry)
>>	sQuery = Strtran(sQuery,'[tcState]',tcState)
>>	sQuery = Strtran(sQuery,'[tcCity]',tcCity)
>>	sQuery = Strtran(sQuery,'[tcZip]',tcZip)
>>	sQuery = Strtran(sQuery,'[tcAddress]',tcAddress)
>>	*sQuery = Strtran(sQuery,'[BING_MAP_KEY]',BING_MAP_KEY)
>>	xhrRequest.Open ("GET", sQuery, .F.)
>>	xhrRequest.Send()
>>	oXML=Createobject('msxml.domdocument')
>>	oXML.LoadXML(xhrRequest.ResponseText)
>>	lcResponse = xhrRequest.ResponseText
>>	Return lcResponse
>
>The "[BING_MAP_KEY]" is apparently already expanded in the initial sQuery string, so that line is not needed.
>
>
&key=Ak3N0GxiMfdssziGDmDvJW3F0Zwo59dop-Q0st6eRNNmCw2Wuvn0RNb3EOg82WlR
>
>It also looks like to parse the return you're looking for "coordinates" and then the text between "[" and "]" after that. It looks like this in general form:
>
>
{"type":"Point","coordinates":[0.000000,0.000000]}
Up to you to parse it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform