<?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: MapView hitTest() doesn't work on certain geometries from FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303434#M81543</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;thanks for your response.&lt;/P&gt;&lt;P&gt;As I mentioned in my opening statement, the issue also happens when the feature layer is being loaded from a server (where it is properly configured with all properties). I simply modified an Esri sample to reproduce the issue and provide an example.&lt;/P&gt;&lt;P&gt;Please double-check the video demo I provided, this issue is about the &lt;STRONG&gt;hitTest&lt;/STRONG&gt; itself. Your solution is unrelated, notice that in your codepen problem still happens, where the hitTest fails to trigger when the mouse pointer is over this area:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucasBertoni_0-1687881229454.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74265iF014CE3A43E1B2E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucasBertoni_0-1687881229454.png" alt="LucasBertoni_0-1687881229454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let me know if you need more details.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 15:55:53 GMT</pubDate>
    <dc:creator>LucasBertoni</dc:creator>
    <dc:date>2023-06-27T15:55:53Z</dc:date>
    <item>
      <title>MapView hitTest() doesn't work on certain geometries from FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1299970#M81414</link>
      <description>&lt;P&gt;Hi, noticed that the hitTest on MapView fails to return some geometries, even though it is very clear they should be hit.&lt;/P&gt;&lt;P&gt;I modified Esri sample and introduced a "problematic" geometry on this codepen, this also happens when the features are being loaded from the server:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/Lucas-Bertoni-the-decoder/pen/jOQWQeV?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/Lucas-Bertoni-the-decoder/pen/jOQWQeV?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a video demonstrating/explaining the issue:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1t4C_QmrEp2z8VrnpRG2rVpKiEfVY7T_o/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1t4C_QmrEp2z8VrnpRG2rVpKiEfVY7T_o/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Has anyone else ever faced such an issue? Why does that happen and how to workaround it?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 20:10:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1299970#M81414</guid>
      <dc:creator>LucasBertoni</dc:creator>
      <dc:date>2023-06-15T20:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: MapView hitTest() doesn't work on certain geometries from FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303402#M81541</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You getting the error because you are trying to query a feature using fields that do not exist on the layer. You must set the fields in the layer's field schema and also set the attributes on the features. &amp;nbsp;Year and name fields do not exist in the case (actually all other fields in this case).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; query.where = "YEAR = " + year + " AND NAME = '" + name + "'";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You also must set the outFields on the FeatureLayer so that fields are also available on the FeatureLayerView since you are doing the query on the layer view. I updated your codepen to add the missing pieces. Please take a look at the codepen:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/MWzJMRR?editors=1000" target="_blank"&gt;https://codepen.io/U_B_U/pen/MWzJMRR?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Some useful docs:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer&lt;/A&gt;&amp;nbsp;- Please read Add an array of client-side features section on how to create client-side feature layer.&lt;/P&gt;&lt;P&gt;FeatureLayer.outFields:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 14:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303402#M81541</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-06-27T14:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: MapView hitTest() doesn't work on certain geometries from FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303434#M81543</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;thanks for your response.&lt;/P&gt;&lt;P&gt;As I mentioned in my opening statement, the issue also happens when the feature layer is being loaded from a server (where it is properly configured with all properties). I simply modified an Esri sample to reproduce the issue and provide an example.&lt;/P&gt;&lt;P&gt;Please double-check the video demo I provided, this issue is about the &lt;STRONG&gt;hitTest&lt;/STRONG&gt; itself. Your solution is unrelated, notice that in your codepen problem still happens, where the hitTest fails to trigger when the mouse pointer is over this area:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucasBertoni_0-1687881229454.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74265iF014CE3A43E1B2E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucasBertoni_0-1687881229454.png" alt="LucasBertoni_0-1687881229454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let me know if you need more details.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 15:55:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303434#M81543</guid>
      <dc:creator>LucasBertoni</dc:creator>
      <dc:date>2023-06-27T15:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: MapView hitTest() doesn't work on certain geometries from FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303638#M81550</link>
      <description>&lt;P&gt;Would have been easier if your codepen did not return errors. In any case, I am able to see the behavior you describe. If you set the SimpleLineSymbol width to &amp;lt;=1.5 then the hittest returns results consistently at the bottom segment. We will look into this behavior and I will update you once we address it.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 21:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1303638#M81550</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-06-27T21:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: MapView hitTest() doesn't work on certain geometries from FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1312238#M81796</link>
      <description>&lt;P&gt;Could this issue be related even though it is JS API 3.x instead of 4.x?&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/snapping-issue-with-arcgis-api-for-javascript-3-x/td-p/1076567" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/snapping-issue-with-arcgis-api-for-javascript-3-x/td-p/1076567&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 19:09:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapview-hittest-doesn-t-work-on-certain-geometries/m-p/1312238#M81796</guid>
      <dc:creator>TimSexton1</dc:creator>
      <dc:date>2023-07-26T19:09:45Z</dc:date>
    </item>
  </channel>
</rss>

