<?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: How to create a FeatureTable from MapImageLayer within a WebMap? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124680#M75548</link>
    <description>&lt;P&gt;Ok so here is a snippet from the code, I tried to pull out anything that would detract from what I am attempting to accomplish.&lt;BR /&gt;&lt;BR /&gt;The code itself:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const ProjectMap: React.FunctionComponent = () =&amp;gt; {
  const mapDiv = useRef&amp;lt;null | HTMLDivElement&amp;gt;(null);
  const [mapView, setMapView] = useState&amp;lt;null | MapView&amp;gt;(null);

    useEffect(() =&amp;gt; {
    if (mapDiv.current) {
      const webMap = new WebMap({
        portalItem: {
          id: 'c63925bb216a4186980d5a7419a7e918',
        },
      });

      const view = new MapView({
        map: webMap,
        container: mapDiv.current,
      });

      view.when(() =&amp;gt; {
        const lyr = webMap.layers.getItemAt(0);
        console.log('layer from webmap:');
        console.log(lyr);
        lyr.allSublayers.find((sublayer) =&amp;gt; sublayer.id === 0);
      });

      setMapView(view);
    }
  }, []);

  return &amp;lt;div ref={mapDiv} className="mapDiv" /&amp;gt;;
};
export default ProjectMap;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The errors that I am seeing related to the types are:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="useEffect.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29354i96AAD8F66CA6C357/image-size/medium?v=v2&amp;amp;px=400" role="button" title="useEffect.png" alt="useEffect.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screen-shot-types.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29355i7945F14CE72C6CE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screen-shot-types.png" alt="screen-shot-types.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; And the console output of the layer that I initially got from the web map is here (showing the loaded value and type of the item):&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="console-log-loaded.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29356i528A8FBB4064EFB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="console-log-loaded.png" alt="console-log-loaded.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="console-log-2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29357i4002A24C0BA2BCD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="console-log-2.png" alt="console-log-2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; I really appreciate you helping with this, I watch all your youtube stuff its great!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 23:31:19 GMT</pubDate>
    <dc:creator>RYANCARL</dc:creator>
    <dc:date>2021-12-09T23:31:19Z</dc:date>
    <item>
      <title>How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124577#M75543</link>
      <description>&lt;P&gt;My goal is to load a &lt;STRONG&gt;sublayer&lt;/STRONG&gt; from my &lt;STRONG&gt;MapImageLayer&lt;/STRONG&gt;&amp;nbsp; into a &lt;STRONG&gt;FeatureTable &lt;/STRONG&gt;so that the table will filter with the extent of the view.&lt;BR /&gt;&lt;BR /&gt;My problem is that when I am querying for the sub layers I am not able to call things like &lt;STRONG&gt;allSublayers&lt;/STRONG&gt; on the &lt;STRONG&gt;MapImageLayer&lt;/STRONG&gt; because typescript says that it is a type &lt;STRONG&gt;esri.Layer&lt;/STRONG&gt; rather than a&amp;nbsp;&lt;STRONG&gt;MapImageLayer&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;So something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const foundLyr = webMap.layers.find((lyr) =&amp;gt; lyr.type === 'map-image');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Does anyone know how to solve this?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 20:21:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124577#M75543</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-12-09T20:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124590#M75544</link>
      <description>&lt;P&gt;Oh, if you are doing this before the View and Map loads, you need to load the webmap, then load the MapImageLayer and then you can get to the sublayers. Not sure about the TS error you're getting, but if you had a github repo, could take a look.&lt;/P&gt;&lt;P&gt;The Sublayer has a createFeatureLayer() method you can use for something like this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then you can create a FeatureTable from the FeatureLayer.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 20:54:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124590#M75544</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-09T20:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124649#M75545</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;I am in a super locked down network and we are using ArcGIS Enterprise. As far as I can tell ArcGIS Online does not allow me to publish a map image layer from ArcPro.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Do you just need the code base or would attempting to provide the data be the best option?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 22:37:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124649#M75545</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-12-09T22:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124652#M75546</link>
      <description>&lt;P&gt;A snippet for the typescript error would help, where you get a type mismatch on the layer. Could be as simple as doing "as Sublayer" or something like that. I don't need the whole code or data.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 22:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124652#M75546</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-09T22:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124680#M75548</link>
      <description>&lt;P&gt;Ok so here is a snippet from the code, I tried to pull out anything that would detract from what I am attempting to accomplish.&lt;BR /&gt;&lt;BR /&gt;The code itself:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const ProjectMap: React.FunctionComponent = () =&amp;gt; {
  const mapDiv = useRef&amp;lt;null | HTMLDivElement&amp;gt;(null);
  const [mapView, setMapView] = useState&amp;lt;null | MapView&amp;gt;(null);

    useEffect(() =&amp;gt; {
    if (mapDiv.current) {
      const webMap = new WebMap({
        portalItem: {
          id: 'c63925bb216a4186980d5a7419a7e918',
        },
      });

      const view = new MapView({
        map: webMap,
        container: mapDiv.current,
      });

      view.when(() =&amp;gt; {
        const lyr = webMap.layers.getItemAt(0);
        console.log('layer from webmap:');
        console.log(lyr);
        lyr.allSublayers.find((sublayer) =&amp;gt; sublayer.id === 0);
      });

      setMapView(view);
    }
  }, []);

  return &amp;lt;div ref={mapDiv} className="mapDiv" /&amp;gt;;
};
export default ProjectMap;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The errors that I am seeing related to the types are:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="useEffect.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29354i96AAD8F66CA6C357/image-size/medium?v=v2&amp;amp;px=400" role="button" title="useEffect.png" alt="useEffect.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screen-shot-types.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29355i7945F14CE72C6CE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screen-shot-types.png" alt="screen-shot-types.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; And the console output of the layer that I initially got from the web map is here (showing the loaded value and type of the item):&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="console-log-loaded.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29356i528A8FBB4064EFB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="console-log-loaded.png" alt="console-log-loaded.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="console-log-2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29357i4002A24C0BA2BCD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="console-log-2.png" alt="console-log-2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; I really appreciate you helping with this, I watch all your youtube stuff its great!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 23:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124680#M75548</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-12-09T23:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a FeatureTable from MapImageLayer within a WebMap?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124904#M75557</link>
      <description>&lt;P&gt;The Collection getItemAt method doesn't know you expect to get a MapImageLayer, so you can do this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const lyr = webMap.layers.getItemAt(0) as MapImageLayer;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Dec 2021 16:25:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-create-a-featuretable-from-mapimagelayer/m-p/1124904#M75557</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-10T16:25:37Z</dc:date>
    </item>
  </channel>
</rss>

