AnsweredAssumed Answered

DynamicMapServiceLayer sublayers

Question asked by 9erNumber16 on Mar 24, 2017
Latest reply on Apr 27, 2017 by 9erNumber16

I have a few interesting cases when trying to load dynamic layers with sublayers.


1) If I create a layer doing something like this:

UserCredentials credentials = new UserCredentials();
credentials.setUserAccount(uname, pword);
ArcGISDynamicMapServiceLayer serviceLayer = new ArcGISDynamicMapServiceLayer(url, int[]{parentId}, credentials);

For a layer with 5 sublayers, all default visible, nothing shows. So I wind up having to initialize the layer, listen for the status change, loop through the layer infos to retrieve the sublayer ids, then add a new layer to the MapView using an array containing the parent and all child IDs. On iOS using just the parent ID is sufficient.


2) If I only want 1 visible sublayer, on iOS I can pass just the ID of the sublayer. But on Android, I have to pass the parent and sublayer IDs. Am I going about this all wrong?