# Class: Geocoder

## (abstract) bemap.Geocoder(context, options)

Base class for geocoder.

## Constructor

#### (abstract) new Geocoder(context, options)

##### Parameters:

Name | Type | Description
--- | --- | ---
`context` | bemap.Context | BeMap-JS-API Context. Mandatory.
`options` | object | see below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`language` | String | Define the language that will be used to perform the address lookup.
`maxResult` | Int | The maximum number of items used to perform the research and returned items by the server. Default is 1.
`boundingBox` | bemap.BoundingBox | the bounding box that will limit the research to a specific area.

Source:
  - bemap-services/bemap-geocoder.js, line 17

### Members

#### (protected) bbox :bemap.BoundingBox

##### Type:

- bemap.BoundingBox

Source:
  - bemap-services/bemap-geocoder.js, line 38

#### (protected) language :String

##### Type:

- String

Source:
  - bemap-services/bemap-geocoder.js, line 26

#### (protected) maxResult :int

##### Type:

- int

Source:
  - bemap-services/bemap-geocoder.js, line 32

### Methods

#### cleanMarkers() → {bemap.markerMapObject}

Reset the geocoding marker object. Clear the previous result.

Source:
  - bemap-services/bemap-geocoder.js, line 422

##### Returns:

this

Type
  bemap.markerMapObject

#### createTable(response, options, container, listener)

Create table in selected div with data from parsing. Event click send by listener

##### Parameters:

Name | Type | Description
--- | --- | ---
`response` | Object | data for create table.
`options` | object | see below the available values.
`container` | DIV | element to create table inside.
`listener` | function | the function to call to get click data

Source:
  - bemap-services/bemap-geocoder.js, line 314

#### geocode(options) → {bemap.Geocoder}

Send a geocoding request to the bemap's server.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | object | See below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`searchInfo` | bemap.GeoSearchInfo | the information to to search.
`geoserver` | object | Geoserver name will be used for this computation.
`success` | function | the function to call in case of successed request.
`failed` | function | the function to call in case of failed request.

Source:
  - bemap-services/bemap-geocoder.js, line 186

##### Returns:

this.

Type
  bemap.Geocoder

#### getBoundingBox() → {bemap.BoundingBox}

Get the bounding box of the research.

Source:
  - bemap-services/bemap-geocoder.js, line 63

##### Returns:

bbox

Type
  bemap.BoundingBox

#### getLanguage() → {String}

Get the language.

Source:
  - bemap-services/bemap-geocoder.js, line 47

##### Returns:

language

Type
  String

#### getMaxResult() → {Int}

Get the number of max results.

Source:
  - bemap-services/bemap-geocoder.js, line 55

##### Returns:

maxResult

Type
  Int

#### revGeocode(options) → {bemap.Geocoder}

Execute the geocoding research.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | object | See below the available values. ###### Properties
Name | Type | Description
--- | --- | ---
`searchInfo` | bemap.RevGeoSearchInfo | the information to to search.
`geoserver` | object | Geoserver name will be used for this computation.
`success` | function | the function to call in case of successed request.
`failed` | function | the function to call in case of failed request.

Source:
  - bemap-services/bemap-geocoder.js, line 151

##### Returns:

this.

Type
  bemap.Geocoder

#### setBoundingBox(bbox) → {bemap.Geocoder}

Set the bounding box of the research.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bbox` | bemap.BoundingBox | the new bounding box to set.

Source:
  - bemap-services/bemap-geocoder.js, line 92

##### Returns:

this.

Type
  bemap.Geocoder

#### setLanguage(language) → {bemap.Geocoder}

Set the language of the research.

##### Parameters:

Name | Type | Description
--- | --- | ---
`language` | String | the new language to set.

Source:
  - bemap-services/bemap-geocoder.js, line 72

##### Returns:

this.

Type
  bemap.Geocoder

#### setMaxResult(maxResult) → {bemap.Geocoder}

Set the number of max results.

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxResult` | Int | the new number of max results.

Source:
  - bemap-services/bemap-geocoder.js, line 82

##### Returns:

this.

Type
  bemap.Geocoder

#### showOnMap(map, response, options, listener)

Parse data to create marker or markers on map

##### Parameters:

Name | Type | Description
--- | --- | ---
`map` | bemap.Map | for creating new marker.
`response` | Object | data to parse in.
`options` | object | see below the available values.
`listener` | function | the function to call to get click data

Source:
  - bemap-services/bemap-geocoder.js, line 377