<?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: arcgis-features and mapimagelayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676773#M88050</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521" target="_blank" rel="noopener"&gt;@LefterisKoumis&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&amp;nbsp; HitTest isn't supported for server based layers like MapImageLayer.&amp;nbsp; You will need to use&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-identify.html" target="_self" rel="nofollow noopener noreferrer"&gt;identify&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;with MapImageLayer.&amp;nbsp; This is a sample that shows how to use identify with a popup, the workflow isn't exactly the same with Features but it should be really similar.&amp;nbsp; If you have a mix of MapImageLayer and FeatureLayer you'll likely need to do a hit test and an identify to get all the results, or load the MapImageLayer sublayers as feature layers in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identify/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/identify/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I think the reason why your seeing the MapImageLayers in the Features component is because the fetchFeatures option for the open method likely sends both a hit test and identify.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jan 2026 16:32:08 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2026-01-08T16:32:08Z</dc:date>
    <item>
      <title>arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676573#M88047</link>
      <description>&lt;P&gt;I use this script to display the popup in the arcgis-features.&lt;/P&gt;&lt;P&gt;I need to determine if the arcgis-features after it runs if it is empty or found features.&lt;/P&gt;&lt;P&gt;If i click on a featurelayer , then the console states that the component is not empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if i click on a mapimagelayer it states that the component is empty even though there is a feature inside the arcgis-features. Why?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; const hitTestResult = await arcgisMap.view.hitTest(screenPoint);
    const mapPoint = arcgisMap.view.toMap(screenPoint);&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;    await arcgisFeatures.open({ 
      location: mapPoint, 
      features: results.map(r =&amp;gt; r.graphic), // Include any client-side features found
      fetchFeatures: true 
    }).then((response) =&amp;gt; {
      checkIfFeaturesEmpty()
    })
   &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function checkIfFeaturesEmpty() {
  if (arcgisFeatures &amp;amp;&amp;amp; arcgisFeatures.features) {
    if (arcgisFeatures.features.length === 0) {
      console.log('The &amp;lt;arcgis-features&amp;gt; component is empty.');
      return true;
    } else {
      console.log('The &amp;lt;arcgis-features&amp;gt; component is not empty and contains ' + arcgisFeatures.features.length + ' features.');
      return false;
    }
  } else {
    console.log('The &amp;lt;arcgis-features&amp;gt; element or its features property is not available yet.');
    return null; 
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 04:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676573#M88047</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2026-01-08T04:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676773#M88050</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521" target="_blank" rel="noopener"&gt;@LefterisKoumis&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&amp;nbsp; HitTest isn't supported for server based layers like MapImageLayer.&amp;nbsp; You will need to use&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-identify.html" target="_self" rel="nofollow noopener noreferrer"&gt;identify&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;with MapImageLayer.&amp;nbsp; This is a sample that shows how to use identify with a popup, the workflow isn't exactly the same with Features but it should be really similar.&amp;nbsp; If you have a mix of MapImageLayer and FeatureLayer you'll likely need to do a hit test and an identify to get all the results, or load the MapImageLayer sublayers as feature layers in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identify/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/identify/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I think the reason why your seeing the MapImageLayers in the Features component is because the fetchFeatures option for the open method likely sends both a hit test and identify.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 16:32:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676773#M88050</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2026-01-08T16:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676798#M88051</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;Are you suggesting to set the fetchFeatures to false and use the identify to collect the features from an mapimagelayer? If that's the case what is the use of the fetchFeatures?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    await arcgisFeatures.open({ 
      location: mapPoint, 
      features: [graphics]
      fetchFeatures: false
    })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For featurelayers we can use this and we don't need fetchFeatures.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;arcgisFeatures.open({
  location: mapPoint,
  features: [graphics]
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 16:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676798#M88051</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2026-01-08T16:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676827#M88052</link>
      <description>&lt;P&gt;I’m not super familiar with the Features component, so apologies if I’m off base here, and I hope I'm not giving bad advice. My understanding is that fetchFeatures should retrieve all results from the mapPoint location—whether they come from a client-side FeatureLayer (or other client-side layers), or from a server-side MapImageLayer. I don’t think it’s necessary to define the features property when fetchFeatures is set to true. I haven't had a chance to test or experiment with this.&lt;/P&gt;&lt;P&gt;I’m guessing a bit about what’s in the results array you’re passing into the features property since that wasn’t included in the code snippets above, but I suspect it's only the results from a hit test. I’ll reach out to the Features PE and see if they can weigh in on this thread to get you an authoritative answer.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 17:35:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676827#M88052</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2026-01-08T17:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676889#M88053</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/14521"&gt;@LefterisKoumis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I checked with our Features expert, and fetchFeatures will return the features for both MapImageLayer and FeatureLayer. This means you don’t need to manually set the features property in addition to enabling fetchFeatures.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The reason the features property appears empty when you test it with your checkIfFeaturesEmpty method is that the open method’s promise resolves when the Features component opens—not when it has finished fetching all features from the map point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;To handle this, set up a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#watch" target="_self"&gt;reactiveUtils.watch&lt;/A&gt;&amp;nbsp;on the features property and then call your checkIfFeaturesEmpty function, similar to what’s demonstrated in this CodePen:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://codepen.io/sagewall/pen/JoKKJGz?editors=1000" target="_blank"&gt;https://codepen.io/sagewall/pen/JoKKJGz?editors=1000&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;viewElement.addEventListener("arcgisViewClick", (event) =&amp;gt; {
        const {
            mapPoint
        } = event.detail;
        arcgisFeatures.open({
            location: mapPoint,
            fetchFeatures: true,
        });
    });
    reactiveUtils.watch(
        () =&amp;gt; arcgisFeatures.features,
        () =&amp;gt; {
            checkIfFeaturesEmpty()
        })

    function checkIfFeaturesEmpty() {
        if (arcgisFeatures &amp;amp;&amp;amp; arcgisFeatures.features) {
            if (arcgisFeatures.features.length === 0) {
                console.log('The &amp;lt;arcgis-features&amp;gt; component is empty.');
                return true;
            } else {
                console.log('The &amp;lt;arcgis-features&amp;gt; component is not empty and contains ' + arcgisFeatures.features.length + ' features.');
                return false;
            }
        } else {
            console.log('The &amp;lt;arcgis-features&amp;gt; element or its features property is not available yet.');
            return null;
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Kudos to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217"&gt;@LaurenBoyd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 19:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676889#M88053</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2026-01-08T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676912#M88054</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217"&gt;@LaurenBoyd&lt;/a&gt;&amp;nbsp;. It makes sense since the fetchFeatures makes calls to the server and we have to wait until it retrieves the feature info. I think this is a good example to add to the documentation since I noticed that there are not many examples of using mapimagelayers with the web components.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 20:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676912#M88054</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2026-01-08T20:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis-features and mapimagelayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676968#M88056</link>
      <description>&lt;P&gt;I have an update&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049" target="_blank"&gt;@Sage_Wall&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217" target="_blank"&gt;@LaurenBoyd&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I used the suggested script and I realized that sometimes the&amp;nbsp;reactiveUtils.watch&amp;nbsp; is not triggered and sometimes it does. I don't what are reasons behind it. So, I modified to use the arcgisPropertyChange&amp;nbsp; property.&lt;/P&gt;&lt;P&gt;so instead of&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    reactiveUtils.watch(
        () =&amp;gt; arcgisFeatures.features,
        () =&amp;gt; {
            checkIfFeaturesEmpty()
        })&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;arcgisFeatures.addEventListener("arcgisPropertyChange", (event) =&amp;gt; {
  if (arcgisFeatures.features.length&amp;gt;0) {
    checkIfFeaturesEmpty();
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 23:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-features-and-mapimagelayer/m-p/1676968#M88056</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2026-01-08T23:42:49Z</dc:date>
    </item>
  </channel>
</rss>

