AnsweredAssumed Answered

LayerList API 4.3 obtain Id of the sublayer on toggle

Question asked by ilanado on Jul 12, 2017
Latest reply on Jul 25, 2017 by KEkenes-esristaff

Hi All,

I'm kind of new on the API 4.3 and I've bean searching everywhere but cant find the answer.


What I basically want to do is that when that all of my sublayers are not visible as default. When the user clicks a sublayer for viewing I would like to get the ID of the sublayer the user clicked so that I can refresh the search widget son that the user can search on the visible sublayer.


i read that with the listitem you can grab it but i don't know how to invoque that parameter on click


Hope someone can help me.


Here is a snippet of how I'm loading the layerlist

layer = new MapImageLayer({
            url: URL

var view = new MapView({
            map: map,
            container: "viewDiv",
            extent: extent

var layerList = new LayerList({
            view: view

view.ui.add(layerList, "top-right");