Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Suggestion for Using Maps with VFP App.
Message
From
07/06/2005 14:42:18
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01021035
Message ID:
01021055
Views:
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

Here is the basics of what I use for Google Maps - which I like best because you can drag the map around.
Function CreateWebMapAddress(tcSource)
   IF tcSource = "GOOGLE"
      lcAddress = "Http://maps.google.com/maps?q="
      lcAddress = lcAddress + ;
         IIF(!EMPTY(m.ad_addr_1), STRTRAN(ALLTRIM(m.ad_addr_1), " ", "+"), "")
      IF !EMPTY(lcAddress) AND !EMPTY(m.ad_addr_2)
         lcAddress = lcAddress + ",+"
      ENDIF
      lcAddress = lcAddress + ;
         IIF(!EMPTY(m.ad_addr_2), STRTRAN(ALLTRIM(m.ad_addr_2), " ", "+"), "")
      IF !EMPTY(lcAddress) AND !EMPTY(m.ad_addr_3)
         lcAddress = lcAddress + ",+"
      ENDIF
      lcAddress = lcAddress + ;
         IIF(!EMPTY(m.ad_addr_3), STRTRAN(ALLTRIM(m.ad_addr_3), " ", "+"), "")
      IF !EMPTY(lcAddress) AND !EMPTY(m.ad_city)
         lcAddress = lcAddress + ",+"
      ENDIF
      lcAddress = lcAddress + ;
         IIF(!EMPTY(m.ad_city), STRTRAN(ALLTRIM(m.ad_city), " ", "+"), "")
      IF !EMPTY(lcAddress) AND !EMPTY(m.ad_region)
         lcAddress = lcAddress + ",+"
      ENDIF
      lcAddress = lcAddress + ;
         IIF(!EMPTY(m.ad_region), STRTRAN(ALLTRIM(m.ad_region), " ", "+"), "")
      IF !EMPTY(lcAddress) AND !EMPTY(m.ad_region)
         lcAddress = lcAddress + "+"
      ENDIF
   ENDIF

RETURN lcAddress
You'd call it by simply doing:
Local lcAddress
lcAddress = GetWebMapAddress('GOOGLE')
and then just run ShellExecute with lcAddress

The reason I have the parameter is that I also give choices for mappoint and for Microsoft. this is just the bit for Google.

The m. variables are from our form Addr_1, addr_2, etc.

Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform