mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (September 2007)
Note: This was revised November 2007 after Google changed the programmatic interface to Google Maps. A description of the old interface can be found here.


        NOTE: In November 2007, Google has said that the following
        information is preliminary and subject to change at any time.


Using Visual CE with Google Maps Mobile

You can easily connect Visual CE to Google Maps Mobile. Once connected, your users can navigate to a record with a location in it, press a button, and then see a map of that location or get directions to it. Clicking OK on the map will close Google Maps Mobile and return the user back to your Visual CE form.

First you need to download Google Maps Mobile and install it on the device. You can download Google Maps Mobile at no charge from the Google web site.

Then, on your Visual CE form, you would need two buttons (or macro steps) to do this. The first is used to formulate the query to send to Google Maps Mobile, the second launches Google Maps Mobile with that query.

For the step to formulate the query, you would use an ASSIGN operation. Most likely the column you are going to assign to will be a variable. If you want to display the map or satellite view of a specific location, the value you assign to that variable will look like something like this:

    -URL "?action=locn&a=Cambridge MA"
    -URL "?action=locn&a=@latlon:-22.54,-43.14"
    -URL "?action=locn&view=mapv&a=1600 Pennsylvania Ave Washington D.C."
    -URL "?action=locn&view=satv&a=Statue of Liberty"
If you want to display the directions from one location to another (for example, from Harvard University to M.I.T.), the value you assign to that variable will look like something like this:
    -URL "?action=rout&start=Harvard University&end=M.I.T."
You can hard code one of these values (just enclose it in single quotes, as you would do for any other character string). Alternatively, you can use a expression to buld the character string dynamically at runtime. For example, if your table had a CITY and STATE column, you could use the expression:
    '-URL "?action=locn&a=' & CITY & ' ' & STATE & '"'

The keywords (URL, action, locn, rout, a, latlon, start, and end) have to be there. The view keyword is optional and you get your choice of map view (mapv) or satellite view (satv). All the keywords have to be lower case (except URL, which must be upper case). And note the hyphens, question marks, equal signs, ampersands, at-signs, colons, and double quotes.

You get quite a bit of leeway in how you can specify the location. You can put in the name of a city and state, a latitude and longitude (Rio de Janeiro is at 22.54 S, 43.14 W), a street address, or even a landmark.

For the step to launch Google Maps Mobile, you would use a RUN EXTERNAL operation. The command would run the Google Maps Mobile appliation. By default, it is installed in

    /Program Files/GoogleMaps/GoogleMaps.exe
The argument would be the variable you assigned in the first step.

Update: October 13, 2010

It has been reported that you can get Google Maps Mobile to display a pin on the map when it opens. Rather than using a string like this:

    -URL "?action=locn&a=@latlon:-22.54,-43.14"
which opens google maps to a GPS location without a pin, use:

    -URL "?action=locn&view=mapv&a=-22.54,-43.14"
to open google maps to a GPS location with a pin.