<?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 How can I restrict the results from an on-premises SMP Locator to a certain country code? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-restrict-the-results-from-an-on-premises/m-p/270470#M24894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using an SMP Locator service as source for the Directions Widget search fields. On text input, the widget fires a "suggest" request to the Locator Service. So far so good. Now, I need to restrict the results to a certain country code.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;From the Directions Widget, single line input is used. I tried adding the country code via the "Search.sources" parameters "suffix" (see &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/search-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/search-amd.html"&gt;Search | API Reference | ArcGIS API for JavaScript&lt;/A&gt;​), but this gave me no results. Using the parameter "countryCode" on "Search.sources" doesn't restrict anything - probably because my Locator service doesn't support it.&lt;/LI&gt;&lt;LI&gt;Here's an article about that problem, but it relates to the deprecated "Geocoder" widget, that was replaced by the "Search" widget: &lt;A href="http://gis.stackexchange.com/questions/101768/restrict-suggestions-from-esri-arcgis-rest-api-to-us-addresses-only" title="http://gis.stackexchange.com/questions/101768/restrict-suggestions-from-esri-arcgis-rest-api-to-us-addresses-only"&gt;geocoding - Restrict suggestions from ESRI ArcGIS REST API to US addresses only - Geographic Information Systems Stack E…&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;The "Locator" object has a "countryCode" parameter, which unfortunately only works with the World Geocoding Service: &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/locator-amd.html#countrycode" title="https://developers.arcgis.com/javascript/3/jsapi/locator-amd.html#countrycode"&gt;Locator | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to enable my local SMP Locator to work with the countryCode parameter? Or is there another way I can restrict my results via some JS parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2016 15:43:14 GMT</pubDate>
    <dc:creator>NiklasKöhn</dc:creator>
    <dc:date>2016-05-17T15:43:14Z</dc:date>
    <item>
      <title>How can I restrict the results from an on-premises SMP Locator to a certain country code?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-restrict-the-results-from-an-on-premises/m-p/270470#M24894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using an SMP Locator service as source for the Directions Widget search fields. On text input, the widget fires a "suggest" request to the Locator Service. So far so good. Now, I need to restrict the results to a certain country code.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;From the Directions Widget, single line input is used. I tried adding the country code via the "Search.sources" parameters "suffix" (see &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/search-amd.html" title="https://developers.arcgis.com/javascript/3/jsapi/search-amd.html"&gt;Search | API Reference | ArcGIS API for JavaScript&lt;/A&gt;​), but this gave me no results. Using the parameter "countryCode" on "Search.sources" doesn't restrict anything - probably because my Locator service doesn't support it.&lt;/LI&gt;&lt;LI&gt;Here's an article about that problem, but it relates to the deprecated "Geocoder" widget, that was replaced by the "Search" widget: &lt;A href="http://gis.stackexchange.com/questions/101768/restrict-suggestions-from-esri-arcgis-rest-api-to-us-addresses-only" title="http://gis.stackexchange.com/questions/101768/restrict-suggestions-from-esri-arcgis-rest-api-to-us-addresses-only"&gt;geocoding - Restrict suggestions from ESRI ArcGIS REST API to US addresses only - Geographic Information Systems Stack E…&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;The "Locator" object has a "countryCode" parameter, which unfortunately only works with the World Geocoding Service: &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/locator-amd.html#countrycode" title="https://developers.arcgis.com/javascript/3/jsapi/locator-amd.html#countrycode"&gt;Locator | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to enable my local SMP Locator to work with the countryCode parameter? Or is there another way I can restrict my results via some JS parameter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 15:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-restrict-the-results-from-an-on-premises/m-p/270470#M24894</guid>
      <dc:creator>NiklasKöhn</dc:creator>
      <dc:date>2016-05-17T15:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I restrict the results from an on-premises SMP Locator to a certain country code?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-restrict-the-results-from-an-on-premises/m-p/270471#M24895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Addition: As a workaround, I'm using the "prefix" parameter on Search.sources, but the results don't strike me as very convincing. &lt;BR /&gt;Example: My SMP-Locator covers several European countries. Search string "edin" (no country restriction) gives back Edinburgh as 1st result, among other international results. Search string "GBR,edin" finds only results from Great Britain, but no Edinburgh. I get a lot of Edingthorpes and Edin Gate, which seem a lot less important. &lt;BR /&gt;I can imagine that this is a matter of how the address locators are organized within the composite locator, but still: I would expect to get the "European results" in that particular order with all but the GBR findings filtered out, because the Locator obviously recognizes "GBR" as a country code..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 09:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-restrict-the-results-from-an-on-premises/m-p/270471#M24895</guid>
      <dc:creator>NiklasKöhn</dc:creator>
      <dc:date>2016-05-18T09:10:47Z</dc:date>
    </item>
  </channel>
</rss>

