Over 46,000+ Business Solution Developers Find answers, ask questions, and connect with our community of business solutions developers, business owners and partners.
Using FileMaker Go 12 to track your Location – FileMaker Today
FileMaker Go 12 has a new mobile function called “Location()”. Location() only works on Mobile devices at this point, so to test this demo file you need to have FileMaker Go 12 installed on your iOS device, an iPhone, iPod or iPad. FileMaker Go is free and available here for the iPhone and here for the iPad.
Once you have one of these apps installed, then click this link in Mobile Safari on your device to download the ‘Where Am I?’ FileMaker 12 Demo file. If you want to download the Demo file on your desktop computer to further dissect scripts in the file, simply right-click the link and select ‘Download linked file’, or transfer it using iTunes.
Downloading the ‘Where Am I?’ Demo file on your iPhone or iPad directly to FileMaker Go 12

Tap the ‘Open in “FileMaker Go” button after clicking this link in Mobile Safari.
Blank screen

Tap the Show Location button. You will be prompted to allow FileMaker Go to have access to your location information, click “OK” to allow the app to use your location in order to display it on a Google Map.
‘Where Am I?’ Map Loaded

If everything is working correctly (you do have a data plan or are connected to a Wi-Fi network right?) your location Longitude and Latitude should be filled in the Point A field and your location should display with a small pin on the Google Map below.
Map loading Directions

- Next enter a destination in the Point B field
- Click the ‘Pt A -> Pt B‘ button
- Tap the pin map icon to display a map version
Displaying text directions from Point A to Point B

At the top of the Web Viewer with the Google Map in it, you will see an icon for text directions as well.
Displaying a Google route map

- Tapping the first icon takes you to your starting place, in this case, where you are
- The second icon displays layers on the map, options include Satellite imagery, Traffic, Bike routes etc.
- The third icon displays a text description of the route between Point A and Point B
‘Where Am I?’ Demo Database running on FileMaker Pro Advanced

If you are interested in how this works, have a look at the database file in FileMaker Pro or FileMaker Pro Advanced on your desktop computer. Stretching out the database to the left a little bit and the Web Viewer can display the map properly in the desktop application.
Key scripts in the ‘Where Am I?’ Demo database

The Show Location script demonstrating how to use the new mobile-only Location() function.
Show Location script

Check out the $Location variable.
New “Location()” function only works on Mobile platforms

The nice thing about this Location function is that you don’t need to send it a Web Viewer and parse the result back. Location() is a standalone function and gets the Longitude and Latitude from Apple’s built in GPS services, cellular network, or WiFi.
Location (accuracy {; timeout}) Location ( 100; 40 ) takes up to 40 seconds to return the latitude and longitude with an accuracy of 100 meters. I haven’t tried tweaking the numbers given in the reference guide, (100 feet and 40 seconds) as they seemed to give good results.
More details on the Location() function is here.
If you read through the rest of the script, all it does is send this Longitude and Latitude data back at Google Maps using a Web Viewer to display your location.
Point A to Point B script – calculated Google URL to create directions on a Map

The second script is similar to the first, except the Location variable is combined with a Point B address to display directions. The calculated URL is displayed above.
Extra Credit: Application ideas

Photo Credit: Flickr Creative Commons: nauright
Some ideas of what one might use the Location function in a FileMaker Go application:
- An application of this might be to record the location whenever a photograph, perhaps for insurance claims, is taken with the iPhone’s camera from within FileMaker Go.
- Another idea would be to add a New Record step to the script, allowing one to create digital ‘bread crumbs’ of a series of locations as one is walking or driving around to track a delivery or merchandising system.
- Creating a looping script that performs the Location function every five minutes while FileMaker Go is running to generate a map of where one has been.
LocationValues() Function

Photo Credit: Flick Creative Commons: rupertuk
Another new Mobile only function is LocationValues (accuracy {; timeout}).
This function returns altitude and horizontal accuracy. The values come back as Return delimited values, listed below which can be parsed using the GetValue function.
- latitude
- longitude
- altitude
- horizontal accuracy (+/- accuracy in meters
- vertical accuracy (+/- accuracy in meters)
- age of value in minutes (0.2 would represent 0.2 minutes or 12 seconds ago)
A mountain climbing tracking app perhaps?