<?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: MapImageLayer allSublayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697526#M64919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tristan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Sure look at the sublayers property:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Only includes the first sublayer from the map service&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapImageLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; sublayers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:20:50 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-12T05:20:50Z</dc:date>
    <item>
      <title>MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697523#M64916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using ArcGIS JS 4.x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attempting to add all of the Layers contained within a Map Server to a Map object. The MapServer can be found at this URL:&amp;nbsp;&lt;A class="link-titled" href="https://alaskafisheries.noaa.gov/arcgis/rest/services/ShoreZoneMapService/MapServer" title="https://alaskafisheries.noaa.gov/arcgis/rest/services/ShoreZoneMapService/MapServer"&gt;ShoreZoneMapService (MapServer)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the relevant code:&lt;/P&gt;&lt;P&gt;var szMapService = new MapImageLayer({&lt;BR /&gt;&lt;SPAN&gt; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Falaskafisheries.noaa.gov%2Farcgis%2Frest%2Fservices%2FShoreZoneMapService%2FMapServer" rel="nofollow" target="_blank"&gt;https://alaskafisheries.noaa.gov/arcgis/rest/services/ShoreZoneMapService/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;The real goal is to parse through all of the layers and only load those that meet certain criteria, but for now I'm trying to load all of them. To check if the layer has loaded, I use console.log( szMapService ) to print out a JSON object of the MapImageLayer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do this, the MapImageLayer seems to have been created successfully, but the allSublayers object contains no layers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/367147_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing something wrong? Why aren't any of my layers being loaded?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 22:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697523#M64916</guid>
      <dc:creator>TristanSebens</dc:creator>
      <dc:date>2017-08-15T22:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697524#M64917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tristan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You have to watch the loaded property.&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; szMapService &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapImageLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Falaskafisheries.noaa.gov%2Farcgis%2Frest%2Fservices%2FShoreZoneMapService%2FMapServer" target="_blank"&gt;https://alaskafisheries.noaa.gov/arcgis/rest/services/ShoreZoneMapService/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
szMapService&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;watch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"loaded"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;szMapService&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:20:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697524#M64917</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697525#M64918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your quick reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added the code you suggested. I also added a function that would print&lt;/P&gt;&lt;P&gt;the status of the 'loaded' attribute when I clicked a button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's been over 10 minutes, and the object still hasn't loaded. There are&lt;/P&gt;&lt;P&gt;about 60 items, so it's possible that it really is just slogging through&lt;/P&gt;&lt;P&gt;all of that data. So, is there a way to limit the layers that are loaded? I&lt;/P&gt;&lt;P&gt;only need about a dozen of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Tue, Aug 15, 2017 at 3:11 PM, Robert Scheitlin, GISP &amp;lt;geonet@esri.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 23:49:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697525#M64918</guid>
      <dc:creator>TristanSebens</dc:creator>
      <dc:date>2017-08-15T23:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697526#M64919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tristan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Sure look at the sublayers property:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Only includes the first sublayer from the map service&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapImageLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA%2FMapServer" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; sublayers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697526#M64919</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697527#M64920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I altered the MapImageLayer to the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var szMapService = new MapImageLayer(&lt;SPAN __jive_macro_name="url"&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just to test the sublayers property. My understanding of the property is&lt;/P&gt;&lt;P&gt;that if I pass an empty array, then no layers will be included in the&lt;/P&gt;&lt;P&gt;MapImageLayer, which should mean that the layer loads more or less&lt;/P&gt;&lt;P&gt;instantly. I'm not seeing that though, the layer is still failing to load.&lt;/P&gt;&lt;P&gt;Am I not using the sublayer's property properly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var szMapService = new MapImageLayer(&lt;SPAN __jive_macro_name="url"&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as id=5 refers to a layer within the map server that will be used in the&lt;/P&gt;&lt;P&gt;final application. Still no response. Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Tue, Aug 15, 2017 at 3:57 PM, Robert Scheitlin, GISP &amp;lt;geonet@esri.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 20:41:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697527#M64920</guid>
      <dc:creator>TristanSebens</dc:creator>
      <dc:date>2017-08-16T20:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer allSublayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697528#M64921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind, I realized my mistake. Since this code is still proof of&lt;/P&gt;&lt;P&gt;concept, the MapImageLayer isn't loaded into any kind of view, which means&lt;/P&gt;&lt;P&gt;that the load() function is never executed. Once I manually called the&lt;/P&gt;&lt;P&gt;load() function, it works as expected, including the sublayer functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Wed, Aug 16, 2017 at 12:41 PM, Tristan Sebens &amp;lt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 20:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-allsublayers/m-p/697528#M64921</guid>
      <dc:creator>TristanSebens</dc:creator>
      <dc:date>2017-08-16T20:52:22Z</dc:date>
    </item>
  </channel>
</rss>

