Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have built a tool that allows my users to perform geocode requests against the World Geocoding Service provided from Esri.

I would like to extend my tool to have an autocomplete feature, similar to how this can be achieved with the Autocomplete class from the Google Geocode API.

Although there is not a similar class available at the Esri service end, I was thinking that you could still hit the geocode service with a GET request, after listening for a slight delay after each keystroke from the end-user in something like a combo-box, and just return the top 5 results based on score.

I am looking for an answer that provides some code (can be pseudocode, or any language) on how to accomplish this, or if this workflow is even achievable. Something similar to this, but against the Esri Geocode service as opposed to map services.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Yes, you can autocomplete against a geocode service.

Pseudo-code:

if >4 chars + keystroke + delay 300ms
  Send Geocode request using text=inputBox.value

Here is how it looks at the front-end:

enter image description here

It waits for user to type in 4 characters, then populates a autocomplete flex component with the response.

When you choose an item from the dropdown, it zoom to the feature, and presents any additional results it found, using a green outline for high confident matches, and orange ones for lesser confident ones.

I have taken it a step further, and allowd the user to configure a bounding box, source country, state, and minimum candidate score within an XML file.

I need to tidy up some of the logic, and then I will try to put it into a flexviewer widget and upload to arcgis.com.

share|improve this answer
    
Just found this which looks awesome github.com/Esri/geocoder-search-widget-js –  Simon Dec 3 '12 at 11:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.