The Search widget
Another, potentially much simpler way of incorporating geocoding functionality in your web mapping applications is to use the Search widget.
The Search widget replaces the earlier Geocoder widget which was deprecated in version 3.13 of the API, and offers additional functionality in that it can be used for searching across multiple data sources, not just locator services but feature layers too.
In addition, it provides a much nicer interface for the user in that it can provide suggestions while the user types their search criteria. For this to work, you need to be using a locator service running on an ArcGIS Server instance of 10.3 or later, with the suggest
capability loaded.
The Search widget works with both geographic and Web Mercator spatial references. If your map uses another spatial reference, you must set a default geometry service so that the server can re-project the input geometries for you on the fly. You can set a default geometry service by using the esri/config...