<?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 Click event in drawn polygon in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558495#M52098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get the click on a polygon that was drawn using Sketch Widget? I tried hitTest, but it brings several results (points and polygons)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently my code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;view.on("click", function (event) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;view.hitTest(event.screenPoint).then(function (response) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(response.results); //results an array of geometrys
&amp;nbsp;&amp;nbsp;&amp;nbsp;});
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:37:47 GMT</pubDate>
    <dc:creator>ThafnySoares</dc:creator>
    <dc:date>2021-12-12T16:37:47Z</dc:date>
    <item>
      <title>Click event in drawn polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558495#M52098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get the click on a polygon that was drawn using Sketch Widget? I tried hitTest, but it brings several results (points and polygons)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently my code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;view.on("click", function (event) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;view.hitTest(event.screenPoint).then(function (response) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;console.log(response.results); //results an array of geometrys
&amp;nbsp;&amp;nbsp;&amp;nbsp;});
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:37:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558495#M52098</guid>
      <dc:creator>ThafnySoares</dc:creator>
      <dc:date>2021-12-12T16:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Click event in drawn polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558496#M52099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thafny,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Just loop through the hit test results and look at the response.results array (which is an array of graphics) Each graphic has a layer property. You check if the layer is the same layer id as your polygon layer that you are interested in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2020 16:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558496#M52099</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-05-22T16:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Click event in drawn polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558497#M52100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!!!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2020 19:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-event-in-drawn-polygon/m-p/558497#M52100</guid>
      <dc:creator>ThafnySoares</dc:creator>
      <dc:date>2020-05-22T19:19:16Z</dc:date>
    </item>
  </channel>
</rss>

