suggest
Warning
To use a suggest in JS API:
- Get the key for the suggest in the developer's dashboard.
- Specify it when connecting the JS API in the format
https://api-maps.yandex.ru/2.1/?lang=ru_RU&apikey=<your key for JS API>&suggest_apikey=<your key for Suggest API>
.
Static function.
Processes requests 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.
Returns a Promise object.
{ vow.Promise } suggest(request[, options])
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]]. |
|
'yandex#map' |
Type: ISuggestProvider|String Search suggestion provider. You can use the 'yandex#map' built-in search suggestion provider for map objects, or specify your own. |
|
— |
Type: Number Maximum number of results to be returned. |
* Mandatory parameter/option.
Example:
ymaps.suggest('myt').then(function (items) {
// items - Array of search suggestions.
});
Mandatory parameter/option.