autoSuggest(words, paramsopt, languageopt) → {Array.<What3Words.PlaceSuggestions>}
Suggests 3 word addresses in response to an incomplete address.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
words |
string |
|
|
Partial 3 word address. The first two words must be complete and there must be at least one letter from the third word.
|
params |
object |
<optional> |
|
Additional parameters such as focus coordinates and bounding shapes.
|
language |
string |
<optional> |
en |
Optional language or locale.
|
-
See:
-
Returns:
Examples:
// Fetch suggestions using default options
const suggestions = connectors.verjio.what3words.autoSuggest('filled.count.s');
// Store the suggestions in a table for display
tables.suggestions.resetTable();
suggestions.forEach(suggestion => {
tables.suggestions.insertRow();
tables.suggestions.address.value = suggestion.nearestPlace;
tables.suggestions.country.value = suggestion.country;
tables.suggestions.words.value = suggestion.words;
});
// Focus suggestions on a particular coordinate
connectors.verjio.what3words.autoSuggest('filled.count.s', { focus: '51.521251,-0.203586' });
// Only return suggestions in a specified country or countries
// In this case, the United Kingdom and Belgium
connectors.verjio.what3words.autoSuggest('filled.count.s', { 'clip-to-country': 'GB,BE' });
// Restrict suggestions to a bounding box, circle or polygon
connectors.verjio.what3words.autoSuggest('filled.count.s', { 'clip-to-bounding-box': '51.521,-0.343,52.6,2.3324' });
// Show more suggestions in the ocean
connectors.verjio.what3words.autoSuggest('filled.count.s', { 'prefer-land': false });