<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Thanks for sharing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258002#M23920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for following up with the answer, Joanne. You beat me to it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 18:31:45 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-11-12T18:31:45Z</dc:date>
    <item>
      <title>esri.dijit.Geocoder/Esri World Locator - can't get sourceCountry to work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258000#M23918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Starting with the sample found at: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jssamples/locator_simple.html" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jssamples/locator_simple.html&lt;/A&gt;&lt;SPAN&gt; and using the documentation at: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jsapi/geocoder-amd.html" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jsapi/geocoder-amd.html&lt;/A&gt;&lt;SPAN&gt;, 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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;geocoder = new Geocoder( &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,autoComplete: true &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,arcgisGeocoder: { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sourceCountry: "CAN" // I've tried "CA" in all my attempts too &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; ,"search" );&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;geocoder = new Geocoder( &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,autoComplete: true &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,arcgisGeocoder: { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; placeholder: "blah" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; ,"search" );&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone provide any input regarding where I'm going wrong in this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;jtm&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 15:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258000#M23918</guid>
      <dc:creator>JoanneMcGraw</dc:creator>
      <dc:date>2013-11-07T15:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: esri.dijit.Geocoder/Esri World Locator - can't get sourceCountry to work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258001#M23919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, when I didn't hear anything via the forums, I contacted ESRI support about this. Below is the incredibly-thorough and well-researched response (including attachments) I received. Unfortunately, while the suggested solution did deal with the autoComplete functionality returning values in Jamaica, its result did not provide the zooming functionality we preferred from the default arcgisGeocoder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the method implemented in the " ModifiedSampleGeocodeDetailsWithSuggest.html" file (that is, editing the REST URL and including the sourceCountry there) gave me a further idea that, I believe, should be supported in future. Still using the default arcgisGeocoder, I added a 'suffix: " Canada"' parameter and this has limited the autocomplete results as desired; as well as giving us the zoom to result functionality we desired. (NOTE: The space before Canada is necessary because it is appending this string to whatever is in the Geocoder's input field.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;geocoder = new Geocoder( &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,autoComplete: true &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,arcgisGeocoder: { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sourceCountry: "CAN"&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,suffix: " Canada" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; ,"search" );&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hoping this helps someone else,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;jtm&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The Esri World Geocoder used as default in the Geocoder dijit can be configured using the "arcgisGeocoder" parameter in the Geocoder constructor.&lt;BR /&gt;The optional configuration parameters listed in the documentation link you listed can be entered like this:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geocoder = new Geocoder({&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcgisGeocoder: {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; placeholder: "Search",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sourceCountry: "CAN"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, "search");&lt;BR /&gt;&lt;BR /&gt;I've used two optional parameters here; "placeholder", and "sourceCountry".&lt;BR /&gt;Here's the full list of countries&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Service_coverage/02r300000018000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/#/Service_coverage/02r300000018000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The "Single input field geocoding" is the REST endpoint being used to generate results. Here's all the information on it &lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Single_input_field_geocoding/02r300000015000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/#/Single_input_field_geocoding/02r300000015000000/&lt;/A&gt;&lt;BR /&gt;You can see that sourceCountry has these Acceptable values:&lt;BR /&gt;- Full country name&lt;BR /&gt;- ISO 3166-1 2-digit country code&lt;BR /&gt;- ISO 3166-1 3-digit country code.&lt;BR /&gt;I recommend using the 3-digits country code, it's easy to write and read.&lt;BR /&gt;&lt;BR /&gt;The sourceCountry parameter doesn't have an effect when suggesting results for auto-compelete but it's working fine when zooming to the first result.&lt;BR /&gt;You can see in the article "Working with suggestions" that the sourceCountry is not one of the input parameters &lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Working_with_suggestions/02r300000238000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/#/Working_with_suggestions/02r300000238000000/&lt;/A&gt;&lt;BR /&gt;So, even if the geocoder dijit sends the sourceCountry as one of the parameters, it won't have an effect.&lt;BR /&gt;&lt;BR /&gt;See the attached HTML file named "ModifiedSample.html" for a working sample that zooms "kingston" to "Kingston, ON" and not "Jamaica" even though the first suggestion is there.&lt;BR /&gt;You can use the JavaScript API Sandbox to quickly test this modified sample &lt;A class="jive-link-external-small" href="http://developers.arcgis.com/en/javascript/sandbox/sandbox.html" rel="nofollow" target="_blank"&gt;http://developers.arcgis.com/en/javascript/sandbox/sandbox.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's another helpful sample that allows you build your own geocoder dijit; Geocoder with custom service &lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jssamples/locator_service.html" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/en/javascript/jssamples/locator_service.html&lt;/A&gt;&lt;BR /&gt;This sample shows how to replace the Esri World Geocoder with another service.&lt;BR /&gt;However, you can use this sample with the Esri World Geocoder, but in a way that can allow you a little bit more control.&lt;BR /&gt;&lt;BR /&gt;When configuring the custom geocoder you need to provide 3 parameters; URL, Name, and singleLineFieldName.&lt;BR /&gt;&lt;BR /&gt;The URL to the Esri World Geocoder service is &lt;A class="jive-link-external-small" href="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer" rel="nofollow" target="_blank"&gt;http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Name is a custom name to refer to this geocoder (you can use multiple geocoders, that's why the name is needed).&lt;BR /&gt;&lt;BR /&gt;singleLineFieldName is the name of the parameter sent to the server.&lt;BR /&gt;The singleLineFieldName for the Esri World Geocoder service is "SingleLine"&lt;BR /&gt;&lt;BR /&gt;See the attached file "ModifiedSampleGeocodeDetailsWithSuggest.html" for a modified sample that calls the Esri World Geocoder but using a custom geocoder as in the sample listed above.&lt;BR /&gt;&lt;BR /&gt;This way doesn't let me specify the sourceCountry as the first modified sample does.&lt;BR /&gt;However, I found that if I modified the URL to include the parameter "sourceCountry=CAN", this limits the search suggestions (autocomplete) and results to Canada.&lt;BR /&gt;Note: This is something that is not in the documentation, and it's something that I found. It's supported by Esri and could change in upcoming releases.&lt;BR /&gt;&lt;BR /&gt;To sum up: The "ModifiedSample.html" shows how to use the geocoder dijit to limit results to Canada but it doesn't limit the autocomplete suggestions.&lt;BR /&gt;The "ModifiedSampleGeocodeDetailsWithSuggest.html" is a possible workaround that limits the results and autocomplete suggestions to Canada.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258001#M23919</guid>
      <dc:creator>JoanneMcGraw</dc:creator>
      <dc:date>2013-11-12T16:58:23Z</dc:date>
    </item>
    <item>
      <title>Thanks for sharing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258002#M23920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for following up with the answer, Joanne. You beat me to it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 18:31:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-dijit-geocoder-esri-world-locator-can-t-get/m-p/258002#M23920</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-11-12T18:31:45Z</dc:date>
    </item>
  </channel>
</rss>

