<?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 4.8 - How to draw a circle with a specific radius ? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744814#M68932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to create a simple Circle, taking example on the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/draw-measure/index.html" rel="nofollow noopener noreferrer" target="_blank"&gt;polygon drawing sample code&lt;/A&gt;:&lt;/P&gt;&lt;H6 id="toc-hId-1005493856"&gt;Code simplified for the example:&lt;/H6&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;const action = draw.create('circle', {});

action.on('vertex-add', (evt) =&amp;gt; this.createCircleGraphic(evt));
action.on('cursor-update', (evt) =&amp;gt; this.createCircleGraphic(evt));
action.on('draw-complete', (evt) =&amp;gt; this.createCircleGraphic(evt));&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function createCircleGraphic(event) {
&amp;nbsp;&amp;nbsp; mapView.graphics.removeAll();

&amp;nbsp;&amp;nbsp;&amp;nbsp;const circle = new Circle({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spatialReference: mapView.spatialReference,
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: event.vertices[0],
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp; const graphic = new Graphic({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry: circle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; symbol: // my symbol,
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp; mapView.graphics.add(graphic);
}&lt;/PRE&gt;&lt;P&gt;But at first the circle was not visible (even at the maximum zoom).&lt;/P&gt;&lt;P&gt;By looking at the devtools, I saw that the extent's dimensions was smaller than 0.001 px...&lt;/P&gt;&lt;P&gt;I could make the circles appear by specifying a radius of 10'000'000 meters, which make me think that something is working wrong...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the devtools I could see that right after instanciating the circle object, it's spatialReference was wrong.&lt;/P&gt;&lt;P&gt;I can reset it right after, and then it become ok, but I dont know if this has any link with the issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did I miss something ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:41:58 GMT</pubDate>
    <dc:creator>RobinChappatte</dc:creator>
    <dc:date>2021-12-12T07:41:58Z</dc:date>
    <item>
      <title>4.8 - How to draw a circle with a specific radius ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744814#M68932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to create a simple Circle, taking example on the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/draw-measure/index.html" rel="nofollow noopener noreferrer" target="_blank"&gt;polygon drawing sample code&lt;/A&gt;:&lt;/P&gt;&lt;H6 id="toc-hId-1005493856"&gt;Code simplified for the example:&lt;/H6&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;const action = draw.create('circle', {});

action.on('vertex-add', (evt) =&amp;gt; this.createCircleGraphic(evt));
action.on('cursor-update', (evt) =&amp;gt; this.createCircleGraphic(evt));
action.on('draw-complete', (evt) =&amp;gt; this.createCircleGraphic(evt));&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function createCircleGraphic(event) {
&amp;nbsp;&amp;nbsp; mapView.graphics.removeAll();

&amp;nbsp;&amp;nbsp;&amp;nbsp;const circle = new Circle({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spatialReference: mapView.spatialReference,
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: event.vertices[0],
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp; const graphic = new Graphic({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry: circle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; symbol: // my symbol,
&amp;nbsp;&amp;nbsp; });

&amp;nbsp;&amp;nbsp; mapView.graphics.add(graphic);
}&lt;/PRE&gt;&lt;P&gt;But at first the circle was not visible (even at the maximum zoom).&lt;/P&gt;&lt;P&gt;By looking at the devtools, I saw that the extent's dimensions was smaller than 0.001 px...&lt;/P&gt;&lt;P&gt;I could make the circles appear by specifying a radius of 10'000'000 meters, which make me think that something is working wrong...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the devtools I could see that right after instanciating the circle object, it's spatialReference was wrong.&lt;/P&gt;&lt;P&gt;I can reset it right after, and then it become ok, but I dont know if this has any link with the issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did I miss something ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:41:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744814#M68932</guid>
      <dc:creator>RobinChappatte</dc:creator>
      <dc:date>2021-12-12T07:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: 4.8 - How to draw a circle with a specific radius ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744815#M68933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tried with different zoom and the visual size of the circle change as the scale of the view change, so it must be an issue with the radius only (and may be "fixed" by finding the good "meter radius --&amp;gt; buggy meter radius" ratio, waiting for the issue to be properly fixed).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 12:19:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744815#M68933</guid>
      <dc:creator>RobinChappatte</dc:creator>
      <dc:date>2018-08-08T12:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: 4.8 - How to draw a circle with a specific radius ?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744816#M68934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;const ARCGIS_CERLE_ISSUE_FIXER = 111500;
const circle = new Circle({
&amp;nbsp;&amp;nbsp; spatialReference: mapView.spatialReference,
&amp;nbsp;&amp;nbsp; center: event.vertices[0],
&amp;nbsp;&amp;nbsp; radius: desiredRadius * ARCGIS_CERLE_ISSUE_FIXER,
});&lt;/PRE&gt;&lt;P&gt;is working fine enougth to me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-8-how-to-draw-a-circle-with-a-specific-radius/m-p/744816#M68934</guid>
      <dc:creator>RobinChappatte</dc:creator>
      <dc:date>2021-12-12T16:52:30Z</dc:date>
    </item>
  </channel>
</rss>

