<?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: Add feature layers with @arcgis/map-components-react in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1534220#M85570</link>
    <description>&lt;P&gt;The map and scene components have methods to add layers, addLayer and add layers.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you can create a layer like you normally would and add it to the component.&lt;/P&gt;&lt;P&gt;Here's a sample adding a graphics layer and using sketch&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/eYwzRER" target="_blank"&gt;https://codepen.io/odoe/pen/eYwzRER&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2024 20:20:51 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2024-09-02T20:20:51Z</dc:date>
    <item>
      <title>Add feature layers with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1534172#M85567</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm migrating our react application from&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core to &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/map-components-react and got most of it working. But I can't seem to figure out how to add a feature layer using these new components. I used to invoke the map.add() function but I no longer have a reference to a map object and don't see a component which represents what I need.&lt;/P&gt;&lt;P&gt;Is there some documentation on the subject that I'm missing or someone can point me to.&lt;/P&gt;&lt;P&gt;Thanks, John&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 18:36:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1534172#M85567</guid>
      <dc:creator>jvpelt</dc:creator>
      <dc:date>2024-09-02T18:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature layers with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1534220#M85570</link>
      <description>&lt;P&gt;The map and scene components have methods to add layers, addLayer and add layers.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/references/map-components/?path=/docs/component-reference-map--docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So you can create a layer like you normally would and add it to the component.&lt;/P&gt;&lt;P&gt;Here's a sample adding a graphics layer and using sketch&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/eYwzRER" target="_blank"&gt;https://codepen.io/odoe/pen/eYwzRER&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 20:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1534220#M85570</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2024-09-02T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature layers with @arcgis/map-components-react</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1535963#M85622</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt; your refs pointed me in the right direction. For those wondering how to make it work with the&amp;nbsp;@arcgis/map-components-react package this is what I came up with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      &amp;lt;ArcgisMap
        itemId={process.env.NX_ArcGISPortalItem}
        basemap="topo-vector"
        spatialReference={SpatialReference.WebMercator}
        zoom={buildZoom({centerLoc, zoom})}
        center={centerPoint}
        onArcgisViewReadyChange={event =&amp;gt; setMapRef(event.target.map)} // This is the magic where we get a ref to the map which makes everything possible again :)
        onArcgisViewClick={onArcGISViewClick}
      &amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Sep 2024 16:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layers-with-arcgis-map-components/m-p/1535963#M85622</guid>
      <dc:creator>jvpelt</dc:creator>
      <dc:date>2024-09-06T16:04:03Z</dc:date>
    </item>
  </channel>
</rss>

