ISuggestProvider
Interface for a provider of search suggestions.
Constructor
ISuggestProvider()
Methods
Name |
Returns |
Description |
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", hl: [[0,5]] }. The displayName field is responsible for representing a toponym in a user-friendly format. The value field is the value that must be inserted in the data entry field after the user selects this suggestion. The hl field is an array of ranges for highlighting to show which part of the result matched the query. The range for highlighting is an array of two numbers: the indexes of the starting and ending symbols of the range. |
Methods details
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", hl: [[0,5]] }. The displayName field is responsible for representing a toponym in a user-friendly format. The value field is the value that must be inserted in the data entry field after the user selects this suggestion. The hl field is an array of ranges for highlighting to show which part of the result matched the query. The range for highlighting is an array of two numbers: the indexes of the starting and ending symbols of the range.
Returns a Promise object.
Parameters:
Parameter |
Default value |
Description |
— |
Type: String Request string. |
|
— |
Type: Object Options. |
|
— |
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]]. |
|
— |
Type: Number Maximum number of results to be returned. |
* Mandatory parameter/option.
Mandatory parameter/option.