AnsweredAssumed Answered

Do not show item in LayerList

Question asked by gregb_mcpao on Apr 18, 2019
Latest reply on Apr 26, 2019 by gregb_mcpao

JS 4.11

 

I am looking for a way to loop through the layers before they get added to my LayerList object and hide some layers.

I can use listItemCreatedFunction: function (event) { } to access the layers and sublayers, but setting layer items visible to false does not work.

 

I tried using LayerListViewModel but I could not find documentation on the class, and it just blows up on function not found.

const layerListViewModel = new LayerListViewModel()({
    view: view
});

layerListViewModel.listItemCreatedFunction = function (event) {

}

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html

Outcomes