Another commonly requested mobile tool is an address search. This takes us from directly working with a feature layer to using an external Geocoding service.
Note
Esri's Geocoding Service can be used to convert an address or a place's name to latitude and longitude. For example, if a user knows an address and wants to put it on a map, geocoding can be used to find the coordinates. In our code example, we will use the free Geocode services that can be found at:
http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer. This is free only if you are not doing batch geocoding and are not saving the results.
For this code example, we will use the same basic code structure that we used for the find feature, in our require function, but we will replace "esri/tasks/query
" with "esri/tasks/locator
".