CLGeocoder.JSON
---------------

Queries data of geo coder as JSON.

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

MBS( "CLGeocoder.JSON"; Geocoder ) 

**MBS**( **"CLGeocoder.JSON";** /\* Queries data of geo coder as JSON. \*/  
**$Geocoder**) /\* The reference number of the geocoder instance. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Geocoder | The reference number of the geocoder instance. | $Geocoder |

### Result

Returns JSON or error.

### Description

Queries data of geo coder as JSON.  
This includes status variables, the error dictionary with details in case of error and the array of place marks with details for a place mark including location, address text and time zone for the location.  
### Examples

Query in one let statement and return JSON or error:

 Let ( \[  
 Address = "Berlin, Germany";  
 // run query and wait a bit  
 g = MBS ( "[CLGeocoder.GeocodeAddressString](CLGeocoderGeocodeAddressString.md)"; Address; 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](CLGeocoderClose.md)"; g ); 0)  
\]; r )  
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](CLGeocoderReverseGeocodeLocation.md)"; 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](CLGeocoderClose.md)"; g ); 0)  
\]; r )  
### See also

- [CLGeocoder.Close](CLGeocoderClose.md)
- [CLGeocoder.Done](CLGeocoderDone.md)
- [CLGeocoder.GeocodeAddressString](CLGeocoderGeocodeAddressString.md)
- [CLGeocoder.ReverseGeocodeLocation](CLGeocoderReverseGeocodeLocation.md)
- [IsError](IsError.md)

### Release notes

- **Version 10.1**
    - Added [CLGeocoder.JSON](https://www.mbsplugins.eu/CLGeocoderJSON.shtml) to return JSON for a geo coder with all details.

### Example Databases

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

### Blog Entries

- [Use MapKit to validate addresses](https://www.mbsplugins.de/archive/2024-02-15/Use_MapKit_to_validate_address/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 8 - Determine your own position](https://www.mbsplugins.de/archive/2023-12-08/MBS_Plugin_Advent_calendar_8_-/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)

### FileMaker Magazin

- [Ausgabe 2/2022, Seite 31](https://filemaker-magazin.de/neuigkeit/4174-Appetithappen-FMM_202202)

This function checks for a license.

Created 12nd February 2020 , last changed 12nd February 2020

  
[CLGeocoder.GeocodeAddressString](CLGeocoderGeocodeAddressString.md) - [CLGeocoder.PlacemarkCount](CLGeocoderPlacemarkCount.md)

[HTML Version](CLGeocoderJSON.shtml)