<?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 layer types for all layers in map service in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204448#M18954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like a charm, and makes the code cleaner too since:&lt;/P&gt;&lt;P&gt;1) Each layer object has a property for the object of it's parent layer, instead of just the id.&lt;/P&gt;&lt;P&gt;2) No need to check if this is the last request before calling my callback function, since there's only one request&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2016 18:36:45 GMT</pubDate>
    <dc:creator>YohanBienvenue</dc:creator>
    <dc:date>2016-02-08T18:36:45Z</dc:date>
    <item>
      <title>Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204443#M18949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if there's an easy way to get the layer types for all the layers in a map service. By layer "type" I mean: Group Layer, Raster Layer, Annotation Layer, Annotation SubLayer, Feature Layer, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2016-02-08_9-07-54.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/179331_2016-02-08_9-07-54.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check the layerInfos array of my ArcGISDynamicLayer, it will tell me the layer id, parent id, etc.. but it won't tell me what the layer type is. I know I could create a FeatureLayer for each layer to get this info, but that would generate more then a hundred requests since the map service has several layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal is to get a list of all the layers with the "Feature Layer" type in the map service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yohan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204443#M18949</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2016-02-08T14:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204444#M18950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I do not think there is any other way then to submit a esriRequest to each of the sublayers in the map service and check the response type for each result. There is no need to create a FeatureLayer for each when you can use esriRequest to just get the json response from the layer with will include the type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a thread that has a sample that uses esriRequest: &lt;A href="https://community.esri.com/thread/166512"&gt;List  ArcGIS Server Services and URLs to Services&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204444#M18950</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-02-08T14:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204445#M18951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right about not needing the FeatureLayer of course. I confused this part with another requirement we have in our code to get the feature layer fields for some specific layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So since this is the way to do it, I tried your suggestion and I think it will do. It's a lot of requests but I didn't notice any significant difference (performance wise) when we load the web app. Plus the requests are cached and will return 304 when it's been done once already. It pollutes the Network tab a bit, but that is a minor issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 15:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204445#M18951</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2016-02-08T15:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204446#M18952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rather than multiple queries, you can use a single query to the &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/All_Layers_and_Tables/02r3000000v0000000/"&gt;All Layers and Tables REST API endpoint&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 17:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204446#M18952</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2016-02-08T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204447#M18953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Great idea, I forgot about that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 17:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204447#M18953</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-02-08T17:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get layer types for all layers in map service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204448#M18954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like a charm, and makes the code cleaner too since:&lt;/P&gt;&lt;P&gt;1) Each layer object has a property for the object of it's parent layer, instead of just the id.&lt;/P&gt;&lt;P&gt;2) No need to check if this is the last request before calling my callback function, since there's only one request&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 18:36:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-layer-types-for-all-layers-in-map-service/m-p/204448#M18954</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2016-02-08T18:36:45Z</dc:date>
    </item>
  </channel>
</rss>

