AnsweredAssumed Answered

Loading sublayer of mapserver layer

Question asked by kfpearson on Dec 10, 2015
Latest reply on Dec 10, 2015 by kenbuja

I have a dynamicmapservice layer that I’m trying to load only one sublayer but the entire layer displays

The mapserver layers are the following:

 

Layer 1 (0)

                Sublayer1 (1)

                Sublayer2 (2)

Layer2(3)

                Sublayer1(4)

                Sublayer2(5)

 

My code:

 

var myLayer = new ArcGISDynamicMapServiceLayer("http…..", {

                id: "myLayer"

            });

            myLayer.setVisibleLayers([5]);

 

All of the sublayers under Layer2(3) load which is Sublayer1(4) & Sublayer(5).  I’ve tried using imageparameters but it doesn’t change anything.

 

var myImagePara = new ImageParameters();

myImagePara.layerIds = [5];

myImagePara.layerOption = ImageParameters.LAYER_OPTION_SHOW;

var myLayer = new ArcGISDynamicMapServiceLayer("http…..", {

                id: "myLayer",

                imageParameters: myImagePara

            });

            myLayer.setVisibleLayers([5]);

 

 

Any advice?

Outcomes