I would like to use the LayerList widget to only show the map service heading without sublayers, if there is only one layer for the service. It seems unnecessary in my interface to display the sublayer if there is only one for the service. Is there a setting in the LayerList or a code example of this. For example, on the first entry, the c0a is not necessary to display.
Thanks!
Dan
Solved! Go to Solution.
Hi @DanielScholes ,
The listMode property on MapImageLayer can be used for this purpose. You'll just want to set it to "hide-children"
https://codepen.io/sagewall/pen/qBwpOjg
const permitsLayer = new MapImageLayer({
portalItem: {
// autocasts as new PortalItem()
id: "d7892b3c13b44391992ecd42bfa92d01"
},
listMode: "hide-children"
});
Hi @DanielScholes ,
The listMode property on MapImageLayer can be used for this purpose. You'll just want to set it to "hide-children"
https://codepen.io/sagewall/pen/qBwpOjg
const permitsLayer = new MapImageLayer({
portalItem: {
// autocasts as new PortalItem()
id: "d7892b3c13b44391992ecd42bfa92d01"
},
listMode: "hide-children"
});
Terrific! Thank you for pointing me to the solution!