<?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 Get coordinates from draw toolbar in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732307#M67858</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the draw toolbar in my application to place a point. I'm pretty new to programming and can't seem to find any concrete way to get the x-y coordinates from that point. Can anyone point me in the right direction? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2013 19:47:02 GMT</pubDate>
    <dc:creator>JessicaKnight1</dc:creator>
    <dc:date>2013-02-26T19:47:02Z</dc:date>
    <item>
      <title>Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732307#M67858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the draw toolbar in my application to place a point. I'm pretty new to programming and can't seem to find any concrete way to get the x-y coordinates from that point. Can anyone point me in the right direction? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 19:47:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732307#M67858</guid>
      <dc:creator>JessicaKnight1</dc:creator>
      <dc:date>2013-02-26T19:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732308#M67859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You will want to listen to the draw toolbar's events, such as: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Draw/onDrawEnd"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#Draw/onDrawEnd&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sample is a good demonstration: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/toolbar_draw"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/toolbar_draw&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also this one: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/mobile_drawtoolbar"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/mobile_drawtoolbar&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 11:51:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732308#M67859</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-02-27T11:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732309#M67860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What I'm trying to do is actually return the x,y coordinates in my application. Are there any samples that really illustrate doing that? As I said, I'm a programming novice and I guess I can't quite connect the dots from the documentation at the moment. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 14:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732309#M67860</guid>
      <dc:creator>JessicaKnight1</dc:creator>
      <dc:date>2013-02-27T14:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732310#M67861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you look at the first sample I linked to, find the 'addToMap' function.&amp;nbsp; This function has been connected to the toolbar's onDrawEnd event, and it illustrates how to take the resulting geometry and add it as a graphic to the map.&amp;nbsp; Within this callback function, you can access all of the properties of the geometry that was drawn on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, in your case, if you just want to handle the x/y coordinates for point features, then try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dojo.connect(toolbar,"onDrawEnd",function(geometry){
&amp;nbsp; if (geometry.type=="point")
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do something.... 
&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(geometry.x+", "+geometry.y);
&amp;nbsp; }
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you open the live sample, and execute the above code in the JavaScript console (pressing F12 will reveal the console for you in recent browsers), you should see coordinates alerted the next time you draw a point feature on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At that point, you can do whatever you need to do with the coordinate values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:15:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732310#M67861</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T07:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732311#M67862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mike is definitely right that using the onDrawEnd event is your best opportunity to capture the values from a sketched point.&amp;nbsp; heres a &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/jagravois/XKqKt/" rel="nofollow noopener noreferrer" target="_blank"&gt;fiddle&lt;/A&gt;&lt;SPAN&gt; that shows how its done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.connect(tb, "onDrawEnd", writeCoordinates);
...
function writeCoordinates(geometry) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.byId("coordinateInfo").innerHTML = "X coordinate is: " + geometry.x.toFixed(3) + ", Y coordinate is: " + geometry.y.toFixed(3);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
...
&amp;lt;span id="coordinateInfo"&amp;gt;&amp;lt;/span&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i adapted it from &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/graphics_add" rel="nofollow noopener noreferrer" target="_blank"&gt;this sample&lt;/A&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:15:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732311#M67862</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2021-12-12T07:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates from draw toolbar</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732312#M67863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks very much. I'll give that a shot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 16:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-from-draw-toolbar/m-p/732312#M67863</guid>
      <dc:creator>JessicaKnight1</dc:creator>
      <dc:date>2013-02-27T16:56:37Z</dc:date>
    </item>
  </channel>
</rss>

