Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GoogleMap-plot more than 2 points?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01351666
Message ID:
01351731
Vues:
28
>Great! Thanks. But how do you get the longitude/latidudes to plot if all you have is addresses???
>Are you going to go to SWFox again this year?
>
>Peter

Here's one way of doing it...
LOCAL lcAddress, lcURL, loXMLHTTP as MSXML2.XMLHTTP, ;
	lcResult, lnWaitCounter, llGotResponse
m.lcAddress = "7651 209th Street North,Forest Lake,MN"
m.loXMLHTTP = CreateObject("MSXML2.XMLHTTP")
m.lcURL = "http://rpc.geocoder.us/service/rest?address=" + STRTRAN(m.lcAddress, " ", "+")
m.loXMLHTTP.open("GET", m.lcURL)
m.loXMLHTTP.send()
m.llGotResponse = .F.
*!* use eventhandler for a better way of handling readyState
*!* for loop is ok though for this example
FOR m.lnWaitCounter = 1 TO 10 && wait 5 seconds max
	IF m.loXMLHTTP.readyState = 4
		m.llGotResponse = .T.
		EXIT
	ENDIF
	=INKEY(.5,"H")
	DOEVENTS FORCE
ENDFOR
IF m.llGotResponse
	CLEAR
	m.lcResult=m.loXMLHTTP.responseText
	? "Longitude: " + STREXTRACT(m.lcResult,"<geo:long>", "</geo:long>",1,1)
	? "Latitude: " + STREXTRACT(m.lcResult,"<geo:lat>", "</geo:lat>",1,1)
	?
	? m.lcResult && Here's what it looks like
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform