AnsweredAssumed Answered

MapImageLayer allSublayers

Question asked by tristan.sebens on Aug 15, 2017
Latest reply on Aug 16, 2017 by tristan.sebens

Using ArcGIS JS 4.x.

 

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: ShoreZoneMapService (MapServer) 

 

Here is the relevant code:

var szMapService = new MapImageLayer({
url: "https://alaskafisheries.noaa.gov/arcgis/rest/services/ShoreZoneMapService/MapServer"
});

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. 

 

When I do this, the MapImageLayer seems to have been created successfully, but the allSublayers object contains no layers. 

 

 

Am I doing something wrong? Why aren't any of my layers being loaded?

Outcomes