<?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: XY Coordinates from Geocoder in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747940#M69176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim, &lt;/P&gt;&lt;P&gt;Thanks for that. So instead of using the Geocoder Widget, use Locator instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hamish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 01:07:36 GMT</pubDate>
    <dc:creator>HamishKingsbury1</dc:creator>
    <dc:date>2015-01-16T01:07:36Z</dc:date>
    <item>
      <title>XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747938#M69174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm developing a routing app using the JS API. One thing I'm looking at trying to implement is having a search box (to find an address) add a stop to create a route.&lt;/P&gt;&lt;P&gt;Currently, I have the search working, it is using our own Geocoding server (not ESRIs) and the Geocoder Widget. It is displaying and zooming to the the location as a point on the map. To perform the routing I am using routeTask. I can input stops by clicking on the map and then solve the route using a button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to be able to do is have the user search for an address, the map zoom to the location. They can then click a button to have the point added as a location on the map. I thought I might be able to use returned JSON but the only thing returned in the console is the GET function getting the new tiles for the area I've zoomed too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone has an idea of how to achieve this, it would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hamish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 01:34:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747938#M69174</guid>
      <dc:creator>HamishKingsbury1</dc:creator>
      <dc:date>2015-01-15T01:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747939#M69175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hamish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the code here: &lt;A href="https://developers.arcgis.com/javascript/jssamples/locator_address.html" title="https://developers.arcgis.com/javascript/jssamples/locator_address.html"&gt;Geocode an address | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of adding a graphic within the showresults function, you can set all the variables within that function and then add the &lt;SPAN class="pln" style="color: #000000;"&gt;map&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;graphics&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;add&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;graphic&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;);&lt;/SPAN&gt;&amp;nbsp; command in your button click function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:34:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747939#M69175</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-01-15T16:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747940#M69176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim, &lt;/P&gt;&lt;P&gt;Thanks for that. So instead of using the Geocoder Widget, use Locator instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hamish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 01:07:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747940#M69176</guid>
      <dc:creator>HamishKingsbury1</dc:creator>
      <dc:date>2015-01-16T01:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747941#M69177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To add to that, It would be good to be able to use the geocoder, as this has a number of useful features such as autocomplete. Can something like this be implemented with Locator?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 01:09:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747941#M69177</guid>
      <dc:creator>HamishKingsbury1</dc:creator>
      <dc:date>2015-01-16T01:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747942#M69178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hamish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my bad for some reason I thought they were using the address locator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check out my app here, where I use the geocoder (with autocomplete) and a graphic to show where the address is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsfiddle.net/timw1984/ahnmv8gy/light/" title="http://jsfiddle.net/timw1984/ahnmv8gy/light/"&gt;Location, Location, Location... - JSFiddle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Especially this part of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14214137572106933 jive_text_macro" jivemacro_uid="_14214137572106933"&gt;&lt;P&gt;geocoder.on("select", showLocation);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the showLocation function associated with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 13:11:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747942#M69178</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-01-16T13:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: XY Coordinates from Geocoder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747943#M69179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cheers for that, I ended up working out a way which would make it work. I declared a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var searchLocation = [0,0];&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the function which displays my results on the map I added the x,y results to the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;searchLocation[0] = evt.result.feature.geometry.x;
searchLocation[1] = evt.result.feature.geometry.y;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works well (I think - it hasn't broken yet) and it allows me to use the coordinates anywhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers for your anyway!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hamish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/xy-coordinates-from-geocoder/m-p/747943#M69179</guid>
      <dc:creator>HamishKingsbury1</dc:creator>
      <dc:date>2021-12-12T07:47:50Z</dc:date>
    </item>
  </channel>
</rss>

