<?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 hitTest and Obscured Features in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143277#M76322</link>
    <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;Hunting for an answer to a scenario I'm dealing with. Using JS API v4.22.2.&lt;/P&gt;&lt;P&gt;I have a 2D map where the user can add layers of varying types (FeatureLayer, MapImageLayer, etc), and also control the layer order on the map. I provide a hover event (resulting in a custom maptip, or possibly something else) when the mouse cursor goes over a visible feature in a FeatureLayer. No hover magic on MapImageLayers.&lt;/P&gt;&lt;P&gt;The hitTest provides me the topmost feature under the mouse from all FeatureLayers, but if that feature is obscured by a symbol from a MapImageLayer higher in the layer stack, I've yet to find a way to detect that case. As is now, the obscured feature will still fire the hover event, which gives a funny user experience. They expect the mouse to be reacting with the visible symbol (in this case, no hover because MapImageLayer), not a reaction from something lurking underneath it.&lt;/P&gt;&lt;P&gt;This wasn't a problem in API v3, as raster layers had to be beneath the vector ones, and the SVG stack had a pretty hard link to what the mouse was over for events.&lt;/P&gt;&lt;P&gt;My guts say the solution is either something obvious that's eluding me, or this "raster overlaying vector" scenario is too niche for the API to support.&lt;/P&gt;&lt;P&gt;For the inevitable "why" question, we use MapImageLayers of features for performance reasons when the feature set is massive.&lt;/P&gt;&lt;P&gt;Any insights are appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Feb 2022 20:00:58 GMT</pubDate>
    <dc:creator>james-rae</dc:creator>
    <dc:date>2022-02-11T20:00:58Z</dc:date>
    <item>
      <title>hitTest and Obscured Features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143277#M76322</link>
      <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;Hunting for an answer to a scenario I'm dealing with. Using JS API v4.22.2.&lt;/P&gt;&lt;P&gt;I have a 2D map where the user can add layers of varying types (FeatureLayer, MapImageLayer, etc), and also control the layer order on the map. I provide a hover event (resulting in a custom maptip, or possibly something else) when the mouse cursor goes over a visible feature in a FeatureLayer. No hover magic on MapImageLayers.&lt;/P&gt;&lt;P&gt;The hitTest provides me the topmost feature under the mouse from all FeatureLayers, but if that feature is obscured by a symbol from a MapImageLayer higher in the layer stack, I've yet to find a way to detect that case. As is now, the obscured feature will still fire the hover event, which gives a funny user experience. They expect the mouse to be reacting with the visible symbol (in this case, no hover because MapImageLayer), not a reaction from something lurking underneath it.&lt;/P&gt;&lt;P&gt;This wasn't a problem in API v3, as raster layers had to be beneath the vector ones, and the SVG stack had a pretty hard link to what the mouse was over for events.&lt;/P&gt;&lt;P&gt;My guts say the solution is either something obvious that's eluding me, or this "raster overlaying vector" scenario is too niche for the API to support.&lt;/P&gt;&lt;P&gt;For the inevitable "why" question, we use MapImageLayers of features for performance reasons when the feature set is massive.&lt;/P&gt;&lt;P&gt;Any insights are appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 20:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143277#M76322</guid>
      <dc:creator>james-rae</dc:creator>
      <dc:date>2022-02-11T20:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest and Obscured Features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143316#M76324</link>
      <description>&lt;P&gt;In response to your preempted "why" question concerning performance, these two articles might be worth reading.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/turbo-charge-your-web-apps-with-client-side-queries/" target="_blank" rel="noopener"&gt;https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/turbo-charge-your-web-apps-with-client-side-queries/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/techniques-for-visualizing-high-density-data-on-the-web/" target="_blank" rel="noopener"&gt;https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/techniques-for-visualizing-high-density-data-on-the-web/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 21:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143316#M76324</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-02-11T21:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest and Obscured Features</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143623#M76330</link>
      <description>&lt;P&gt;Appreciate the links, learned a few new features from it. Unfortunately the server aggregation appears to be AGOL only and the rest need the vertices already on the client or a modded service.&amp;nbsp; So I'm either solving this or writing a work-around (like hoisting the hover'd symbol to a secret layer above everything to at least give context to the maptip).&lt;/P&gt;&lt;P&gt;Regardless, thanks again for replying.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 15:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-and-obscured-features/m-p/1143623#M76330</guid>
      <dc:creator>james-rae</dc:creator>
      <dc:date>2022-02-14T15:09:51Z</dc:date>
    </item>
  </channel>
</rss>

