<?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: Is it possible to calculate circle radius while drawing it? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418067#M38432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var centerPt=null; //description:get distance between ptB and centerPt //return: number function getDistance(ptB){&amp;nbsp; if(centerPt==null||centerPt.mapPoint==null){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("unexpected para,function getDistance()"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ""; &amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp; var ptA=centerPt.mapPoint; &amp;nbsp;&amp;nbsp; return Math.sqrt(Math.pow(ptA.x-ptB.x,2)+Math.pow(ptA.y-ptB.y,2));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; //onDragStart, record the centerPt dojo.connect(mapAppObj.map,"onMouseDragStart",function(evt){&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; console.log("dragStart triggered"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centerPt=evt;&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; //onDrag, calculate distance between currentPoint and centerPt dojo.connect(mapAppObj.map,"onMouseDrag",function(evt){ &amp;nbsp;&amp;nbsp; var radius=getDistance(evt.mapPoint); &amp;nbsp;&amp;nbsp; console.log("radius is:"+radius); &amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2013 01:37:44 GMT</pubDate>
    <dc:creator>Imihiro</dc:creator>
    <dc:date>2013-10-10T01:37:44Z</dc:date>
    <item>
      <title>Is it possible to calculate circle radius while drawing it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418066#M38431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The main idea is to show some info somewhere about the current drawed radius before draw-end event (before I have actually released a mouse button). But it looks like there is no way to make it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was thinking about capturing mappoint right after the Draw toolbar is activated and then continuously capturing the second mappoint while dragging, and sending both mappoints to some tool to calculate distance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But may be there is more simple way? (without "dancing around the drum")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 20:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418066#M38431</guid>
      <dc:creator>AndreyLabodin</dc:creator>
      <dc:date>2013-10-09T20:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to calculate circle radius while drawing it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418067#M38432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var centerPt=null; //description:get distance between ptB and centerPt //return: number function getDistance(ptB){&amp;nbsp; if(centerPt==null||centerPt.mapPoint==null){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("unexpected para,function getDistance()"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ""; &amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp; var ptA=centerPt.mapPoint; &amp;nbsp;&amp;nbsp; return Math.sqrt(Math.pow(ptA.x-ptB.x,2)+Math.pow(ptA.y-ptB.y,2));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; //onDragStart, record the centerPt dojo.connect(mapAppObj.map,"onMouseDragStart",function(evt){&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; console.log("dragStart triggered"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centerPt=evt;&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; //onDrag, calculate distance between currentPoint and centerPt dojo.connect(mapAppObj.map,"onMouseDrag",function(evt){ &amp;nbsp;&amp;nbsp; var radius=getDistance(evt.mapPoint); &amp;nbsp;&amp;nbsp; console.log("radius is:"+radius); &amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 01:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418067#M38432</guid>
      <dc:creator>Imihiro</dc:creator>
      <dc:date>2013-10-10T01:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to calculate circle radius while drawing it?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418068#M38433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 07:00:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-calculate-circle-radius-while/m-p/418068#M38433</guid>
      <dc:creator>AndreyLabodin</dc:creator>
      <dc:date>2013-10-10T07:00:15Z</dc:date>
    </item>
  </channel>
</rss>

