geocoder widget issues: no results on first search, result select doesn't always work

592
0
04-28-2013 05:18 PM
KimFisher
New Contributor
I'm loving the new Geocoder Widget, but two issues are preventing me from using in production. I'm using 3.3, but get the same results with 3.4 at
http://help.arcgis.com/en/webapi/javascript/arcgis/sandbox/sandbox.html?sample=locator_widget
My extent is New York.

1. When the user first types an address, e.g. '19th st and 6th ave', no results are returned initially. If the user then presses a space, the search is repeated and a list of candidates is returned. Hitting backspace to remove the space and repeat the search, the list is preserved. Occasionally I have gotten a single result after the first search for a 'St Anne' address, which made me think that the search is being sent too quickly. But I tried setting searchDelay to a much larger number, with no improvement.

2. With autoNavigate set to true, sometimes, under conditions I can't precisely determine, once a user has a list of results, using arrow keys and then hitting the enter key fills the search box with the selected item but does not autoNavigate. Clicking the result with the mouse in these situations has the same effect.

Any ideas? Here is the init function which when pasted into the sandbox above yields these results:

      function init() {
        var map = new esri.Map("map",{
          basemap: "topo",
          center: [-74,40.73], //long, lat
          zoom: 13
        });
        
        geocoder = new esri.dijit.Geocoder({
            maxLocations: 10,
            autoComplete: true,
            map:          map,
    
            arcgisGeocoder: {
                url:           "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",
                name:          "Esri World Geocoder",
                suffix:        "new york, ny",
                placeholder:   "Find a place",
                sourceCountry: "USA" // limit search to the United States
            }
        },"search");
        geocoder.startup();
      }
0 Kudos
0 Replies