<?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 Re: Composite Geocode Service Returns Multiple Results in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281104#M25967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Yue, it was helpful.&amp;nbsp; I added maxLocations to the code, but it's still returning two results.&lt;/P&gt;&lt;P&gt;I'm not sure whether I added the parameter incorrectly or whether its not supported for this.&lt;/P&gt;&lt;P&gt;Would you say the following snippet looks right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function locate() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var add = dojo.byId("address").value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var address = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Street : add,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxLocations : 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(address,["Loc_name"]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jul 2015 13:09:02 GMT</pubDate>
    <dc:creator>CraigCarsley</dc:creator>
    <dc:date>2015-07-07T13:09:02Z</dc:date>
    <item>
      <title>Composite Geocode Service Returns Multiple Results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281102#M25965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use a composite geocoding service in a javascript web app, but it returns a result from each of the address locators (Address_Points &amp;amp; Street_Centerlines) referenced by the composite locator.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a parameter I can set, somewhere, that tells the geocoder to return ONLY the BEST result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281102#M25965</guid>
      <dc:creator>CraigCarsley</dc:creator>
      <dc:date>2015-07-06T16:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Geocode Service Returns Multiple Results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281103#M25966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Craig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several ways to limit the geocoder widget to return result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to do it is to set maxLocations that returns after you typed the name of location, please take a look about this API reference: &lt;A href="https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#maxlocations" title="https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#maxlocations"&gt;Geocoder | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;The other way is to set some specifications for geocoder. Take a look this &lt;A href="https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#geocoder1"&gt;page &lt;/A&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#geocoder1" title="https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#geocoder1"&gt;https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#geocoder1 &lt;/A&gt;and search "&lt;SPAN style="font-weight: bold; color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;Object Specifications" &lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt;for details.&lt;/SPAN&gt;&lt;SPAN style="font-weight: bold; color: #4d4d4d; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif;"&gt; &lt;/SPAN&gt;It sounds like you are using your own custom geocoder, so you better to make sure if those all specifications are available for your geocoder. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Here is a sample code to append suffix to restrict the result to "Redlands" &lt;A href="https://developers.arcgis.com/javascript/jssamples/locator_widget.html" title="https://developers.arcgis.com/javascript/jssamples/locator_widget.html"&gt;Geocoder - append default suffix | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is another similar thread about geocoder suggestions you can take as a references &lt;A href="https://community.esri.com/thread/119441"&gt;filtering Geocoder for a specific country&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this can help! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 16:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281103#M25966</guid>
      <dc:creator>YueWu1</dc:creator>
      <dc:date>2015-07-06T16:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Geocode Service Returns Multiple Results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281104#M25967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Yue, it was helpful.&amp;nbsp; I added maxLocations to the code, but it's still returning two results.&lt;/P&gt;&lt;P&gt;I'm not sure whether I added the parameter incorrectly or whether its not supported for this.&lt;/P&gt;&lt;P&gt;Would you say the following snippet looks right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function locate() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.clear();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var add = dojo.byId("address").value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var address = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Street : add,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxLocations : 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locator.addressToLocations(address,["Loc_name"]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 13:09:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281104#M25967</guid>
      <dc:creator>CraigCarsley</dc:creator>
      <dc:date>2015-07-07T13:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Geocode Service Returns Multiple Results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281105#M25968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Craig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing you can do is when you using the chrome and open the developer tools and check the network tab, every time when you type something on the search widget bar, you can find the web requests that generate from javascript client and make sure the maxLocations parameter is right as you put in code, sometimes you may put the wrong location and the parameter not honored.&lt;/P&gt;&lt;P&gt;Please take this snippet code as a reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to put the maxLocations under geocoder object not geocoders, the reason is because you add geocoders into geocoder to use your own composed geocoder. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var geocoders = [{
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://nwu-win7.esri.com/server/rest/services/AtlantaGeolocator/GeocodeServer" target="_blank"&gt;http://nwu-win7.esri.com/server/rest/services/AtlantaGeolocator/GeocodeServer&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: "AtlantaGeolocator Geocoder",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; singleLineFieldName: "Single Line Input",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; }];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var geocoder = new Geocoder({
&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;&amp;nbsp;&amp;nbsp; geocoders: geocoders,
&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp; autoNavigate: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minCharacters: 3,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcgisGeocoder: false,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxLocations: 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },"search");&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="geocode.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/117173_geocode.JPG" style="width: 620px; height: 249px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:38:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281105#M25968</guid>
      <dc:creator>YueWu1</dc:creator>
      <dc:date>2021-12-11T13:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Composite Geocode Service Returns Multiple Results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281106#M25969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help, Yue.&amp;nbsp; I got some one-on-one help at the ESRI UC, and found a very simple solution. &lt;/P&gt;&lt;P&gt;All I needed to do was change one character...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/119313_pastedImage_9.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/119315_pastedImage_11.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 19:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/composite-geocode-service-returns-multiple-results/m-p/281106#M25969</guid>
      <dc:creator>CraigCarsley</dc:creator>
      <dc:date>2015-07-27T19:03:06Z</dc:date>
    </item>
  </channel>
</rss>

