Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Suggestion for Using Maps with VFP App.
Message
De
07/06/2005 14:49:47
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01021035
Message ID:
01021058
Vues:
28
>Hi
>
>I am interested to learn about other people's experiences with incorporating maps into a VFP app (i.e. an address is selected in the application and a map of the location should be displayed).
>
>I would like to know what solutions people used to obtain and show a map. Did you you as web service from a mapping website or did you use a third party control etc.
>
>I just want to get a feel for the issues involved for an upcoming project.
>
>Thanks,
>Simon

This may not be the greatest, but it works. It opens IE to http://maps.google.com and naviages to the presented address.
*--------------------------------------------
*  Place we are looking for
*--------------------------------------------
cAddress = "1303 Silver St Sumner Wa"


DECLARE Sleep IN kernel32 INTEGER millisec
LOCAL loIE
*--------------------------------------------
*  Open IE
*--------------------------------------------
loIE=CREATEOBJECT('internetexplorer.application')
loIE.Silent = .T.			&& no dialogs

LOCAL st, lntsec
lntsec = SECONDS()

*--------------------------------------------
*  Navigate to Google's Map site.   (way cool place).
*--------------------------------------------
loIE.Navigate( "http://maps.google.com" )


*--------------------------------------------
*  wait until complete
*--------------------------------------------

st =  SECONDS()
Sleep(50)
DO WHILE .T.
	IF NOT VERSION(5)=700
		DOEVENTS	
** In 7.0, the DoEvents behavior changed to stop and wait for event.  
** In 8.0, the behavior was changed back to 6.0 behavior.
	ENDIF
	DO CASE
		CASE loIE.readyState=4 AND NOT loIE.busy
			EXIT
		CASE loIE.readyState=3 AND SECONDS()-st > 5
			EXIT
		CASE SECONDS()-st > 20
			EXIT
	ENDCASE
	Sleep(50)
ENDDO


*--------------------------------------------
*  Make visible
*--------------------------------------------
loIE.VISIBLE = .T.

*--------------------------------------------
*  Send the address and Carriage Return.
*--------------------------------------------
LOCAL oShell
oShell = CREATEOBJECT("WScript.Shell")

oShell.SendKeys( cAddress + "{enter}" )

RETURN
Greg Reichert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform