<?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 Using Locator in 4.5 api for geocoding in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700046#M65197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying without much success to geocode an address in my javascript application using the Locator.&amp;nbsp; I set up a geocode service, and tested that service successfully, but calling it from javascript returns nothing.&amp;nbsp; There really isn't much as far as samples for this Locator object (esri/tasks/Locator), so I'm hoping maybe someone has done this successfully and could share this info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the function (with the address passed into val), as far as I can tell the parameters are passed in as an object, and the promise returns the value returned by the geocode service.&amp;nbsp; I just get a 0 length array when I do this.&amp;nbsp; (The city, "GILB", is an abbreviated city code that we use in our streets layer.&amp;nbsp; This works when querying the geocode service itself).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var addr={&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Street": val,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "City": "GILB"&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; addLoc.outSpatialReference=view.spatialReference;&lt;BR /&gt;&amp;nbsp; addLoc.addressToLocations(addr).then(function(response) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(response);&lt;BR /&gt;&amp;nbsp; })&lt;BR /&gt;&amp;nbsp; .otherwise(function(err) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.alert(val + " Not Found (geo)");&lt;BR /&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The response I get is the 0 length array, and not the "Not Found" dialog, so I think this is not creating an error, just not getting the value from the geocode service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has had success with this, and would be willing to point me in the right direction, I would be grateful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2017 19:34:45 GMT</pubDate>
    <dc:creator>JeffSauder</dc:creator>
    <dc:date>2017-11-08T19:34:45Z</dc:date>
    <item>
      <title>Using Locator in 4.5 api for geocoding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700046#M65197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying without much success to geocode an address in my javascript application using the Locator.&amp;nbsp; I set up a geocode service, and tested that service successfully, but calling it from javascript returns nothing.&amp;nbsp; There really isn't much as far as samples for this Locator object (esri/tasks/Locator), so I'm hoping maybe someone has done this successfully and could share this info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the function (with the address passed into val), as far as I can tell the parameters are passed in as an object, and the promise returns the value returned by the geocode service.&amp;nbsp; I just get a 0 length array when I do this.&amp;nbsp; (The city, "GILB", is an abbreviated city code that we use in our streets layer.&amp;nbsp; This works when querying the geocode service itself).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var addr={&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Street": val,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "City": "GILB"&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; addLoc.outSpatialReference=view.spatialReference;&lt;BR /&gt;&amp;nbsp; addLoc.addressToLocations(addr).then(function(response) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(response);&lt;BR /&gt;&amp;nbsp; })&lt;BR /&gt;&amp;nbsp; .otherwise(function(err) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.alert(val + " Not Found (geo)");&lt;BR /&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The response I get is the 0 length array, and not the "Not Found" dialog, so I think this is not creating an error, just not getting the value from the geocode service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has had success with this, and would be willing to point me in the right direction, I would be grateful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 19:34:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700046#M65197</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2017-11-08T19:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Locator in 4.5 api for geocoding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700047#M65198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Your issue in your code is that your object does not have an address property:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; addr&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"address"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"Street"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; val&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"City"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GILB"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:28:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700047#M65198</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Locator in 4.5 api for geocoding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700048#M65199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it, Robert.&amp;nbsp;&amp;nbsp;An oversight on my part I guess.&amp;nbsp; Thank you so much, it works now&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 19:57:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-locator-in-4-5-api-for-geocoding/m-p/700048#M65199</guid>
      <dc:creator>JeffSauder</dc:creator>
      <dc:date>2017-11-13T19:57:49Z</dc:date>
    </item>
  </channel>
</rss>

