<?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: Get FeatureLayer from Map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182241#M16942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is it really a FeatureLayer in the Web Map then? Are you sure it is not a Whole MapService and thus a MapImageLayer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jul 2018 20:48:02 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-07-26T20:48:02Z</dc:date>
    <item>
      <title>Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182236#M16937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am a little stuck here and I hope someone can point me to the right place. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the ArcGIS-js-api in Angular / Typescript&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to display a WebMap via an internal Portal instance.&lt;/P&gt;&lt;P&gt;I can access the Layers that the Map is composed of but I am unable to get the layer as a featureLayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the examples I see are adding a featureLayer to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get a featureLayer from the Map?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 18:04:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182236#M16937</guid>
      <dc:creator>PaulGiard</dc:creator>
      <dc:date>2018-07-26T18:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182237#M16938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you are taking 3.x then it is as simple as:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; incidentLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"incidentLayer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This assumes you know the id of the layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182237#M16938</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T09:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182238#M16939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response,&lt;/P&gt;&lt;P&gt;I am using 4.8 and there is no getLayer method on the Map&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 19:56:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182238#M16939</guid>
      <dc:creator>PaulGiard</dc:creator>
      <dc:date>2018-07-26T19:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182239#M16940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Be sure to add a tag to your post or some text stating the API version your are targeting.&lt;/P&gt;&lt;P&gt;So in 4.x when using a WebMap you just use the WebMaps findLayerById&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#findLayerById" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#findLayerById"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#findLayerById&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182239#M16940</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-07-26T20:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182240#M16941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did try that and I get the same issue as when I loop through the Layer Collection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FindLayerById returns a Layer and I don't know how to cast to a FeatureLayer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #d4d4d4; font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #2d2d30; text-decoration-style: initial; text-decoration-color: initial;"&gt;Type 'Layer' is not assignable to type 'FeatureLayer'.&lt;/SPAN&gt;&lt;BR style="color: #d4d4d4; font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #2d2d30; text-decoration-style: initial; text-decoration-color: initial;" /&gt;&lt;SPAN style="color: #d4d4d4; font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #2d2d30; text-decoration-style: initial; text-decoration-color: initial;"&gt; Property 'capabilities' is missing in type 'Layer'.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182240#M16941</guid>
      <dc:creator>PaulGiard</dc:creator>
      <dc:date>2018-07-26T20:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182241#M16942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is it really a FeatureLayer in the Web Map then? Are you sure it is not a Whole MapService and thus a MapImageLayer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182241#M16942</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-07-26T20:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182242#M16943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I loop through the layers the type is feature&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our C# code on Xamarin with the .Net API autocasts the same layer as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:52:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182242#M16943</guid>
      <dc:creator>PaulGiard</dc:creator>
      <dc:date>2018-07-26T20:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182243#M16944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If that is the case then when you use findLayerById then the returned layer will already be a FeatureLayer class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 21:35:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182243#M16944</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-07-26T21:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182244#M16945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like it is a problem with Typings.&amp;nbsp; The code works when casting directly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff;"&gt;const&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; featureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; esri.FeatureLayer &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.mapView.map.findLayerById(&lt;/SPAN&gt;&lt;SPAN style="color: #a31515;"&gt;'69bf94b82f1a4ff8b7afcf370b8c00db'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; esri.FeatureLayer;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 15:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/182244#M16945</guid>
      <dc:creator>PaulGiard</dc:creator>
      <dc:date>2018-07-27T15:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get FeatureLayer from Map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/1066782#M73453</link>
      <description>&lt;P&gt;Isn't there a way to do this without providing the value through a hard-coded string?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var layers = this.map.getLayers();
// process layers in a for-each loop...&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-featurelayer-from-map/m-p/1066782#M73453</guid>
      <dc:creator>diaconori</dc:creator>
      <dc:date>2021-06-10T08:33:01Z</dc:date>
    </item>
  </channel>
</rss>

