Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CLGeocoder.ReverseGeocodeLocation

Submits a reverse-geocoding request for the specified location.

Component Version macOS Windows Linux Server iOS SDK
CLGeocoder 4.1 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "CLGeocoder.ReverseGeocodeLocation"; latitude; longitude { ; wait } )   More

Parameters

Parameter Description Example Flags
latitude The latitude of the coordinate.
longitude The longitude of the coordinate.
wait Available in MBS FileMaker Plugin 10.1 or newer.
Pass 1 to wait for geocoder to have a result.
Pass 0 to not wait and check later if geocoder is done.
1 Optional

Result

Returns reference number or error.

Description

Submits a reverse-geocoding request for the specified location.
This method submits the specified location data to the geocoding server asynchronously and returns. Your completion handler block will be executed on the main thread. After initiating a reverse-geocoding request, do not attempt to initiate another reverse- or forward-geocoding request.
Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. When the maximum rate is exceeded, the geo coder passes an error back.
You need to use CLGeocoder.Close later to free the geo coder.
CoreLocation geo coder reference numbers are starting at 24000 and counting up for each new geo coder.

Seems to not work on server as it always times out.

Examples

Reverse geocode location:

MBS("CLGeocoder.ReverseGeocodeLocation"; CLGeocoder::Latitude; CLGeocoder::Longitude)

Run query and get back JSON or error:

Let ( [
    latitude = 52.517631899999998;
    longitude = 13.4096574;
    // run query and wait a bit
    g = MBS( "CLGeocoder.ReverseGeocodeLocation"; latitude; longitude; 1 );
    e = MBS("IsError");
    // query JSON if we got something
    r = If (e = 0; MBS( "CLGeocoder.JSON"; g ); g);
    // free resources
    f = If (e = 0; MBS( "CLGeocoder.Close"; g ); 0)
]; r )

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 29th February 2024


CLGeocoder.PlacemarkValue - CLibrary.GetTag