IGeocodeProvider

Interface for a geocoder provider.

Constructor | Methods

Constructor

IGeocodeProvider()

Methods

Name

Returns

Description

geocode(request[, options])

vow.Promise

Sends a request for geocoding. A handler function for processing geocoding results can be added via the returned promise object. The object input to the handler function can contain only the following types of fields: geoObjects, layers, mapState, and metaData.

suggest(request[, options])

vow.Promise

Sends a request for search suggestions. Returns a promise object that is either rejected with an error, or confirmed by an array of objects in the format { displayName: "Mitishi, Moscow region", value: "Russia, Moscow region, Mitishi " }. The displayName field represents the toponym in a user-friendly way, and the value field represents the value which should be inserted into the search field after the user selects the suggestion.

This method is optional.

Methods details

geocode

{vow.Promise} geocode(request[, options])

Sends a request for geocoding. A handler function for processing geocoding results can be added via the returned promise object. The object input to the handler function can contain only the following types of fields: geoObjects, layers, mapState, and metaData.

Returns Promise object.

Parameters:

Parameter

Default value

Description

request*

—

Type: String

Request string.

options

—

Type: Object

Options.

options.boundedBy

—

Type: Number[][]

A rectangular area on the map, where the object being searched for is presumably located. Must be set as an array, such as [[30, 40], [50, 50]].

options.results

—

Type: Number

Maximum number of results to be returned.

options.skip

—

Type: Number

Number of results that must be skipped.

options.strictBounds

—

Type: Boolean

Search only inside the area defined by the "boundedBy" option.

* Mandatory parameter/option.

suggest

{vow.Promise} suggest(request[, options])

Sends a request for search suggestions. Returns a promise object that is either rejected with an error, or confirmed by an array of objects in the format { displayName: "Mitishi, Moscow region", value: "Russia, Moscow region, Mitishi " }. The displayName field represents the toponym in a user-friendly way, and the value field represents the value which should be inserted into the search field after the user selects the suggestion.

This method is optional.

Returns a Promise object.

Parameters:

Parameter

Default value

Description

request*

—

Type: String

Request string.

options

—

Type: Object

Options.

options.boundedBy

—

Type: Number[][]

A rectangular area on the map, where the object being searched for is presumably located. Must be set as an array, such as [[30, 40], [50, 50]].

options.results

—

Type: Number

Maximum number of results to be returned.

options.strictBounds

—

Type: Boolean

Search only inside the area defined by the "boundedBy" option.

* Mandatory parameter/option.