CLGeocoder.GeocodeAddressString
-------------------------------

Submits a forward-geocoding request using the specified string.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CLGeocoder](component_CLGeocoder.md) | [4.1](newinversion41.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "CLGeocoder.GeocodeAddressString"; Address { ; Wait } ) 

**MBS**( **"CLGeocoder.GeocodeAddressString";** /\* Submits a forward-geocoding request using the specified string. \*/  
**$Address**; /\* A string describing the location you want to look up. For example, you could specify the string "1 Infinite Loop, Cupertino, CA"” to locate Apple headquarters.e.g. "Andernach, Germany" \*/   
**$Wait**) /\* Optional; Pass 1 to wait for geocoder to have a result.  
Pass 0 to not wait and check later if geocoder is done.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Address | A string describing the location you want to look up. For example, you could specify the string "1 Infinite Loop, Cupertino, CA"” to locate Apple headquarters. | "Andernach, Germany" |  |
| Wait | Pass 1 to wait for geocoder to have a result.   Pass 0 to not wait and check later if geocoder is done. | 1 | Optional      Added in version **10.1**. |

### Result

Returns reference number or error.

### Description

Submits a forward-geocoding request using the specified string.  
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 forward-geocoding request, do not attempt to initiate another forward- or reverse-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](CLGeocoderClose.md) later to free the geo coder.  
  
Seems to not work on server as it always times out.  
### Examples

Geocodes an address:

 $r = MBS ("CLGeocoder.GeocodeAddressString"; CLGeocoder::AddressString )  
Query in one let statement and return JSON or error:

 Let ( \[  
 Address = "Berlin, Germany";  
 // run query and wait a bit  
 g = MBS ( "CLGeocoder.GeocodeAddressString"; Address; 1 );  
 e = MBS ("IsError");  
 // query JSON if we got something  
 r = If (e = 0; MBS ( "[CLGeocoder.JSON](CLGeocoderJSON.md)"; g ); g);  
 // free resources  
 f = If (e = 0; MBS ( "[CLGeocoder.Close](CLGeocoderClose.md)"; g ); 0)  
\]; r )  
### See also

- [CLGeocoder.Close](CLGeocoderClose.md)
- [CLGeocoder.JSON](CLGeocoderJSON.md)
- [IsError](IsError.md)

### Release notes

- **Version 14.1**
    - Added timeout for [CLGeocoder.GeocodeAddressString](https://www.mbsplugins.eu/CLGeocoderGeocodeAddressString.shtml) and [CLGeocoder.ReverseGeocodeLocation](https://www.mbsplugins.eu/CLGeocoderReverseGeocodeLocation.shtml) functions.
- **Version 10.1**
    - Added wait parameter for [CLGeocoder.GeocodeAddressString](https://www.mbsplugins.eu/CLGeocoderGeocodeAddressString.shtml) or [CLGeocoder.ReverseGeocodeLocation](https://www.mbsplugins.eu/CLGeocoderReverseGeocodeLocation.shtml) function.

### Example Databases

- [Mac and iOS/CoreLocation/Address Mapping](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/CoreLocation/Address%20Mapping.shtml#1ScriptAnchor_)
- [Mac and iOS/CoreLocation/CLGeocoder](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/CoreLocation/CLGeocoder.shtml#1ScriptAnchor_)
- [Mac and iOS/MapKit/MapView BeeExample](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/MapKit/MapView%20BeeExample.shtml#36ScriptAnchor_)
- [Mac and iOS/MapKit/Validate Address](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/MapKit/Validate%20Address.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 14.1pr5](https://www.mbsplugins.de/archive/2024-03-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Use MapKit to validate addresses](https://www.mbsplugins.de/archive/2024-02-15/Use_MapKit_to_validate_address/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.1](https://www.mbsplugins.de/archive/2020-03-17/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr4](https://www.mbsplugins.de/archive/2020-02-15/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Core Location Geocoder with JSON](https://www.mbsplugins.de/archive/2020-02-12/Core_Location_Geocoder_with_JS/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[CLGeocoder.ErrorMessage](CLGeocoderErrorMessage.md) - [CLGeocoder.JSON](CLGeocoderJSON.md)

[HTML Version](CLGeocoderGeocodeAddressString.shtml)