Skip to main content
Commonmark migration
Source Link

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.

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.

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.

Source Link

Get existing layer by name from map having multiple map/feature services in ArcGIS Javascript API 3.x

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.