I have a map server url from an ArcGIS REST Services. The ......../MapServer url contains 35 layers of point, line, and polygon features. I need to bring in all of them and have the ability to turn each on on and off. I know I can bring in each one individually, but that's 35 variables for each individual url (..../MapServer/0, 1, 2 etc...)
Right now I only know how to utilize the method shown in this turorial; https://developers.arcgis.com/kotlin/layers/tutorials/add-a-feature-layer/
Is there a way crawl the top level MapServer url and bring in the 35 layers, but still be able to individually control each layer i.e. make visible / invisible?