AnsweredAssumed Answered

esri.dijit.Geocoder/Esri World Locator - can't get sourceCountry to work

Question asked by myESRIUName on Nov 7, 2013
Latest reply on Nov 12, 2013 by aeldibesri-ca-esridist
Hello,

Starting with the sample found at: https://developers.arcgis.com/en/javascript/jssamples/locator_simple.html and using the documentation at: https://developers.arcgis.com/en/javascript/jsapi/geocoder-amd.html, I have tried to figure out how to limit the results the Geocoder dijit returns to only those existing in Canada. I'm obviously having trouble understanding the documentation because I am unable to get this to work.

When I type "kingston" in the Geocoder dijit's field, the number one choice returned is in Jamaica not Ontario as I would expect (to be frank, I wouldn't expect to see an entry like Kingston, Jamaica at all in this but at a minimum I would expect the Canadian entries to have higher priority).

I have tried changing the instantiation of the geocoder variable in the sample as follows (among others but this seems the most likely given my understanding of what I'm reading):

geocoder = new Geocoder(     {         map: map         ,autoComplete: true         ,arcgisGeocoder: {             sourceCountry: "CAN" // I've tried "CA" in all my attempts too         }     }     ,"search" );


I don't actually want to not use the default World Locator service, I'm just trying to configure it. Am I supposed to fill in everything, including the URL or something? I wouldn't have thought so because if I add a placeholder parameter instead, that seems to work fine.

geocoder = new Geocoder(     {         map: map         ,autoComplete: true         ,arcgisGeocoder: {             placeholder: "blah"         }     }     ,"search" );


Can anyone provide any input regarding where I'm going wrong in this?

Cheers,
jtm

Outcomes