<?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: &amp;lt;arcgis-sketch&amp;gt; Selection event for lasso / rectangle in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690479#M88299</link>
    <description>&lt;P&gt;Thanks for the help yesterday, I came up with a solution to my issue.&amp;nbsp; &amp;nbsp;Basically, I'm trying to select features on StreamLayers / FeatureLayers that are under the Lasso Selection tool.&amp;nbsp; This is now working, and I'm getting the graphics I need, so if anyone else needs help doing this, try this method.&lt;/P&gt;&lt;P&gt;I'm not sure if there is a better method, but this seems to work.&amp;nbsp; On another point, that draw tool was only active because of another issue, I'm only using the Sketch component for the Lasso / Rectangular selections.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;sketchWidgetPointerDownEvent &lt;/SPAN&gt;= &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;on&lt;/SPAN&gt;(&lt;SPAN&gt;"pointer-down"&lt;/SPAN&gt;, (event) =&amp;gt; {&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Got Pointer Down Event'&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;sketch &lt;/SPAN&gt;= &lt;SPAN&gt;document&lt;/SPAN&gt;.&lt;SPAN&gt;querySelector&lt;/SPAN&gt;(&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;arcgis-sketch&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;) &lt;SPAN&gt;as any&lt;/SPAN&gt;;&lt;BR /&gt;    &lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;activeTool &lt;/SPAN&gt;= &lt;SPAN&gt;sketch&lt;/SPAN&gt;?.&lt;SPAN&gt;activeTool&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Active Tool: '&lt;/SPAN&gt;, &lt;SPAN&gt;activeTool&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;activeTool &lt;/SPAN&gt;!== &lt;SPAN&gt;'polygon'&lt;/SPAN&gt;) &lt;SPAN&gt;return&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;hitTest&lt;/SPAN&gt;(event).&lt;SPAN&gt;then&lt;/SPAN&gt;((response) =&amp;gt; {&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;(response.&lt;SPAN&gt;results&lt;/SPAN&gt;.&lt;SPAN&gt;length&lt;/SPAN&gt;) {&lt;BR /&gt;            &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;lassoSet &lt;/SPAN&gt;= &lt;SPAN&gt;true&lt;/SPAN&gt;;&lt;BR /&gt;        }&lt;BR /&gt;    })&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;sketchWidgetPointerUpEvent &lt;/SPAN&gt;= &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;on&lt;/SPAN&gt;(&lt;SPAN&gt;"pointer-up"&lt;/SPAN&gt;, (event) =&amp;gt; {&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Got Pointer Up Event'&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;hitTest&lt;/SPAN&gt;(event).&lt;SPAN&gt;then&lt;/SPAN&gt;((response: &lt;SPAN&gt;any&lt;/SPAN&gt;) =&amp;gt; {&lt;BR /&gt;        &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Response'&lt;/SPAN&gt;);&lt;BR /&gt;        &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(response);&lt;BR /&gt;    })&lt;BR /&gt;});&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 13 Mar 2026 14:57:42 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2026-03-13T14:57:42Z</dc:date>
    <item>
      <title>&lt;arcgis-sketch&gt; Selection event for lasso / rectangle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690310#M88295</link>
      <description>&lt;P&gt;Good Day&lt;BR /&gt;&lt;BR /&gt;What is the event thrown by the Lasso selection tool?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;arcgis-sketch&lt;BR /&gt;    hide-settings-menu&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-snapping-controls&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-create-tools-circle&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-create-tools-multipoint&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-create-tools-point&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-create-tools-rectangle&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-create-tools-polyline&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    hide-undo-redo-menu&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    layout&lt;/SPAN&gt;&lt;SPAN&gt;="horizontal"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    (arcgisCreate)&lt;/SPAN&gt;&lt;SPAN&gt;="&lt;/SPAN&gt;&lt;SPAN&gt;onSketchUpdate&lt;/SPAN&gt;(&lt;SPAN&gt;$event&lt;/SPAN&gt;)&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    (arcgisPropertyChange)&lt;/SPAN&gt;&lt;SPAN&gt;="&lt;/SPAN&gt;&lt;SPAN&gt;onSketchUpdate&lt;/SPAN&gt;(&lt;SPAN&gt;$event&lt;/SPAN&gt;)&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    (arcgisUpdate)&lt;/SPAN&gt;&lt;SPAN&gt;="&lt;/SPAN&gt;&lt;SPAN&gt;onSketchUpdate&lt;/SPAN&gt;(&lt;SPAN&gt;$event&lt;/SPAN&gt;)&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    [layer]&lt;/SPAN&gt;&lt;SPAN&gt;="&lt;/SPAN&gt;&lt;SPAN&gt;sketchLayer&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    referenceElement&lt;/SPAN&gt;&lt;SPAN&gt;="mapElement&lt;/SPAN&gt;{{&lt;SPAN&gt;_mapId &lt;/SPAN&gt;=== &lt;SPAN&gt;1 &lt;/SPAN&gt;? &lt;SPAN&gt;'1' &lt;/SPAN&gt;: &lt;SPAN&gt;'2'&lt;/SPAN&gt;}}&lt;SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    [view]&lt;/SPAN&gt;&lt;SPAN&gt;="&lt;/SPAN&gt;&lt;SPAN&gt;_view&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;BR /&gt;&amp;lt;/arcgis-sketch&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The property change event seems to throw something, but not the create or update event, so once I finish drawing how do I get the area I just made, so I can run the intersect check?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Mar 2026 19:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690310#M88295</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2026-03-12T19:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: &lt;arcgis-sketch&gt; Selection event for lasso / rectangle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690338#M88296</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/51173"&gt;@AndrewMurdoch1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After a selection is made, the &lt;STRONG&gt;arcgisUpdate&lt;/STRONG&gt; event is triggered. It's important to note that this event is also fired when you update the selected graphic or when you unselect the current graphic. To ensure that your function runs right after the graphic is selected (and not updated or unselected), check that the event's &lt;STRONG&gt;state&lt;/STRONG&gt; property is &lt;STRONG&gt;"start"&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can find more details about the arcgisUpdate event here:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/types/#UpdateEvent" rel="noopener" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/types/#UpdateEvent&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I've also created a simple codepen that demonstrates this. Create a polygon to see the &lt;STRONG&gt;arcgisCreate&lt;/STRONG&gt; event. Then, select the polygon to observe that the &lt;STRONG&gt;arcgisUpdate&lt;/STRONG&gt; event being called.&lt;/P&gt;&lt;P&gt;Codepen:&amp;nbsp;&lt;A href="https://codepen.io/woriginales/pen/YPGNZmj" rel="noopener" target="_blank"&gt;https://codepen.io/woriginales/pen/YPGNZmj&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 20:41:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690338#M88296</guid>
      <dc:creator>WesleyO</dc:creator>
      <dc:date>2026-03-12T20:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: &lt;arcgis-sketch&gt; Selection event for lasso / rectangle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690342#M88297</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;That solution is definitely working, so I must have something off on my production code.&amp;nbsp;&amp;nbsp;Very helpful to have a stable solution. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 20:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690342#M88297</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2026-03-12T20:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: &lt;arcgis-sketch&gt; Selection event for lasso / rectangle</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690479#M88299</link>
      <description>&lt;P&gt;Thanks for the help yesterday, I came up with a solution to my issue.&amp;nbsp; &amp;nbsp;Basically, I'm trying to select features on StreamLayers / FeatureLayers that are under the Lasso Selection tool.&amp;nbsp; This is now working, and I'm getting the graphics I need, so if anyone else needs help doing this, try this method.&lt;/P&gt;&lt;P&gt;I'm not sure if there is a better method, but this seems to work.&amp;nbsp; On another point, that draw tool was only active because of another issue, I'm only using the Sketch component for the Lasso / Rectangular selections.&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;sketchWidgetPointerDownEvent &lt;/SPAN&gt;= &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;on&lt;/SPAN&gt;(&lt;SPAN&gt;"pointer-down"&lt;/SPAN&gt;, (event) =&amp;gt; {&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Got Pointer Down Event'&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;sketch &lt;/SPAN&gt;= &lt;SPAN&gt;document&lt;/SPAN&gt;.&lt;SPAN&gt;querySelector&lt;/SPAN&gt;(&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;arcgis-sketch&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;) &lt;SPAN&gt;as any&lt;/SPAN&gt;;&lt;BR /&gt;    &lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;activeTool &lt;/SPAN&gt;= &lt;SPAN&gt;sketch&lt;/SPAN&gt;?.&lt;SPAN&gt;activeTool&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Active Tool: '&lt;/SPAN&gt;, &lt;SPAN&gt;activeTool&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;activeTool &lt;/SPAN&gt;!== &lt;SPAN&gt;'polygon'&lt;/SPAN&gt;) &lt;SPAN&gt;return&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;hitTest&lt;/SPAN&gt;(event).&lt;SPAN&gt;then&lt;/SPAN&gt;((response) =&amp;gt; {&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;(response.&lt;SPAN&gt;results&lt;/SPAN&gt;.&lt;SPAN&gt;length&lt;/SPAN&gt;) {&lt;BR /&gt;            &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;lassoSet &lt;/SPAN&gt;= &lt;SPAN&gt;true&lt;/SPAN&gt;;&lt;BR /&gt;        }&lt;BR /&gt;    })&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;sketchWidgetPointerUpEvent &lt;/SPAN&gt;= &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;on&lt;/SPAN&gt;(&lt;SPAN&gt;"pointer-up"&lt;/SPAN&gt;, (event) =&amp;gt; {&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Got Pointer Up Event'&lt;/SPAN&gt;);&lt;BR /&gt;&lt;BR /&gt;    &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;_view&lt;/SPAN&gt;.&lt;SPAN&gt;hitTest&lt;/SPAN&gt;(event).&lt;SPAN&gt;then&lt;/SPAN&gt;((response: &lt;SPAN&gt;any&lt;/SPAN&gt;) =&amp;gt; {&lt;BR /&gt;        &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(&lt;SPAN&gt;'Response'&lt;/SPAN&gt;);&lt;BR /&gt;        &lt;SPAN&gt;console&lt;/SPAN&gt;.&lt;SPAN&gt;log&lt;/SPAN&gt;(response);&lt;BR /&gt;    })&lt;BR /&gt;});&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Mar 2026 14:57:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/lt-arcgis-sketch-gt-selection-event-for-lasso/m-p/1690479#M88299</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2026-03-13T14:57:42Z</dc:date>
    </item>
  </channel>
</rss>

