LocationValues

Returns the current latitude, longitude, and altitude on an iOS or iPadOS device running FileMaker Go; their accuracy; and minutes since the values were returned.

Format 

LocationValues ( accuracy {; timeout } )

Parameters 

accuracy - any numeric expression or field containing a number that represents a distance in meters.

timeout - any numeric expression or field containing a number that represents the most time it will take to fetch the location. Measured in seconds, the default value is 60.

Parameters in braces { } are optional.

Data type returned 

Text

Originated in version 

12.0

Description 

This function returns the current latitude, longitude, and altitude on a device running FileMaker Go; returns the horizontal and vertical accuracy of the values returned; and number of minutes since the values were returned. The location is obtained via GPS, cellular network, or Wi-Fi.

Returns and caches the current location of a device in the format:

Copy
latitude
longitude
altitude (in meters)
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)

You can use the GetValue function to retrieve any of the six carriage return-delimited values above.

LocationValues fetches the location values until the requested accuracy is met or until timeout. If you cancel the process, FileMaker Go returns the most accurate location in the cache (if any). If no location is received, FileMaker Go returns an empty string.

In FileMaker Pro, LocationValues returns an empty string.

Notes 

  • Each returned value, except that last, ends with a carriage return.
  • To avoid excessive battery consumption and repeat fetches, specify a larger number for accuracy and a smaller number for timeout.

Example 1 

LocationValues ( 100 ; 40 ) returns the following location for a device:

37.406489
-121.983428
0.0545050
65
10
0.001236