<?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 JS API 4.17 sketch widget rectangle, how to get height width in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743081#M68754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can you get height and width in screen pixels of a rectangle drawn with the sketch widget?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Oct 2020 14:57:39 GMT</pubDate>
    <dc:creator>johnbrosowsky</dc:creator>
    <dc:date>2020-10-20T14:57:39Z</dc:date>
    <item>
      <title>JS API 4.17 sketch widget rectangle, how to get height width</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743081#M68754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can you get height and width in screen pixels of a rectangle drawn with the sketch widget?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 14:57:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743081#M68754</guid>
      <dc:creator>johnbrosowsky</dc:creator>
      <dc:date>2020-10-20T14:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: JS API 4.17 sketch widget rectangle, how to get height width</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743082#M68755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get the geometry (extent) use the xmin, ymin, xmax, ymax to create a points then the views toScreen method to get the point screen coordinates and do the math.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 15:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743082#M68755</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-10-20T15:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: JS API 4.17 sketch widget rectangle, how to get height width</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743083#M68756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can listen to create event on the sketch. When the create operation is completed, check the tool that created a shape, then divide the rectangle polygon extent's width and height by the view resolution. This will give you the rectangle polygon's extent width and heights in pixels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;sketch&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"create"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;// when draw rectangle create event is completed&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;state &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"complete"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tool &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"rectangle"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
     console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;width &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;resolution&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"pixels"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
     console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;height &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;resolution&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"pixels"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a doc for the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resolution" rel="nofollow noopener noreferrer" target="_blank"&gt;MapView.resolution&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:37:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-4-17-sketch-widget-rectangle-how-to-get/m-p/743083#M68756</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-12-12T07:37:19Z</dc:date>
    </item>
  </channel>
</rss>

