Suggestions displayed as characters are added using a widget and the geocoding serivce
What is autosuggest?
Autosuggest, also known as autocomplete, is the process of using incomplete text to search for place names and addresses. For example, you can search for "New Y", "Dodgers S", and "Cali" to get a list of suggested place names that match.
You can use autosuggest to build applications that:
Autocomplete addresses and places as you type.
Provide a list of suggestions for incomplete address and place names.
Refine place names and addresses to improve geocoding accuracy.
How autosuggest works
You can get address and place name suggestions by making an HTTP request to the geocoding service suggest operation or by using client APIs. Specify the address or place name text, and optionally, additional parameters to refine the search.
You can provide text for a partial place name or a partial address to get search results. Typically 2-3 characters are needed to start searching.
To refine the search and improve accuracy, you can provide additional information such as the location, search extent, category, and country code.
The geocoding service parses the text and uses all of the parameters provided to return a set of suggestions. Each suggestion contains text (address or place name), isCollection (single distinct place or multiple with the same name or category), and magicKey (search identifier) properties.
The partial address or place name. Different formats are supported.
text=starbutext=100, main sttext=New Y
Additional parameters: Refine the search by using parameters such as location, searchExtent, category, and countryCode.
Examples
Get suggestions for a string
This example finds suggestions for the string New Y. To find the actual address and location for a suggestion, you have to pass each text and magicKey value to the geocoding service. Most APIs provide a LocatorTask to access the service.
The response is a set of suggestions (max of 5) containing the text and magicKey properties. Use these properties to search for the complete address with a location.
APIs
ArcGIS API for JavaScriptEsri LeafletMapbox GL JSOpenLayersArcGIS REST JSArcGIS Runtime API for .NETArcGIS Runtime API for AndroidArcGIS Runtime API for iOSArcGIS Runtime API for JavaArcGIS Runtime API for Qt (C++)ArcGIS Runtime API for Qt (QML)