<?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 Query On Click help in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-on-click-help/m-p/1405205#M84209</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to using Javascript and i'm trying to change&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query/#:~:text=The%20FeatureLayerView%20provides%20access%20to,layer%20view%20once%20it's%20created." target="_self"&gt; this ESRI example&lt;/A&gt; to use a click event as input for the query rather than a view change.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code i've been working on can be found here:&amp;nbsp;&amp;nbsp;&lt;A href="https://codepen.io/bmittler/pen/jORYZOR" target="_blank"&gt;https://codepen.io/bmittler/pen/jORYZOR&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I seem to be have issues with the for loop, im guess that data isnt being fed into the for loop correctly but im not sure why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 14:15:59 GMT</pubDate>
    <dc:creator>BenjaminMittler</dc:creator>
    <dc:date>2024-04-03T14:15:59Z</dc:date>
    <item>
      <title>Query On Click help</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-on-click-help/m-p/1405205#M84209</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to using Javascript and i'm trying to change&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query/#:~:text=The%20FeatureLayerView%20provides%20access%20to,layer%20view%20once%20it's%20created." target="_self"&gt; this ESRI example&lt;/A&gt; to use a click event as input for the query rather than a view change.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code i've been working on can be found here:&amp;nbsp;&amp;nbsp;&lt;A href="https://codepen.io/bmittler/pen/jORYZOR" target="_blank"&gt;https://codepen.io/bmittler/pen/jORYZOR&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I seem to be have issues with the for loop, im guess that data isnt being fed into the for loop correctly but im not sure why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-on-click-help/m-p/1405205#M84209</guid>
      <dc:creator>BenjaminMittler</dc:creator>
      <dc:date>2024-04-03T14:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Query On Click help</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-on-click-help/m-p/1405251#M84212</link>
      <description>&lt;P&gt;You are not waiting for the queryFeatures method to resolve to return the results. You can make the following changes to get your codepen working. Notice that I added &lt;EM&gt;async&lt;/EM&gt; to the click event handler and &lt;EM&gt;await&lt;/EM&gt; to the layerView.queryFeatures...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; reactiveUtils.on(
  () =&amp;gt; view,  "click", async (event) =&amp;gt; {
    console.log("Click event emitted: ", event);
    try {
      const featureSet = await layerView.queryFeatures({
        geometry: event.mapPoint,
        returnGeometry: true,
        orderByFields: ["GEOID"]
      });
     // rest of the code&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-on-click-help/m-p/1405251#M84212</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-04-03T15:22:59Z</dc:date>
    </item>
  </channel>
</rss>

