I want to get existing layers from map and toggle on the visibility of the layers. The map has multiple services. I have the rest url for the service or the layer. And able to access the layer by using let fLayer = new FeatureLayer(url,....).
But when I tried on set visibility by using
fLayer.setVisibility(true) or fLayer.show()
didn't work for me.
I have the information on the required layer names or ids in the respective services and the service urls.
Is there any possibility to get a layer from map using the service url and the layer name/id in that service? Please suggest.