AnsweredAssumed Answered

LayerList with token protected layer

Question asked by consodata2 on May 20, 2016
Latest reply on May 24, 2016 by consodata2

Hi to all,

im going to set up Layer List in this way:

 

var llWidget = new LayerList({
                    map: map,
                    showLegend: true,
                    showOpacitySlider: true,
                    layers: [{
                        layer: mylayer,
                        id: "mylayerID",
                        subLayers: true
                    }]
                }, "layerList");
                llWidget.startup();

 

Note that mylayer becomes from a request for a token protected lite this:

 

var mylayer= new ArcGISDynamicMapServiceLayer(url_mylayer + "?token=" + token, {})

 

Doesn't work .... error is invalid tokens when request to legends it's made. How can i set layer to layer list in thic case ?

Where's the mistake?

 

Thank's in advanced to all

GP

 

 

Outcomes