Manage layers by view

164
1
Jump to solution
05-31-2018 02:07 AM
StéphaneVouillamoz
New Contributor

Hi,

We are using the ESRI 4.6 Javascript API and we are trying to have 2 maps synchronized as in the ESRI sample below, except we are using 2 MapViews:
Synchronize MapView and SceneView | ArcGIS API for JavaScript 4.7 

We are wondering if there was a way to make each view able to show/hide its layers independently. As of now, with the layer list widget, it seems that if you hide a layer from one view it affects the other view. Is there a way to change this behaviour without dealing with multiple Map objects?


Thanks for your insight.

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

You can set something up to change the visibility of the LayerView that manages the Layer. This visible property is independent of the source Layer visibility.

FeatureLayerView | API Reference | ArcGIS API for JavaScript 4.7 

This samples shows how to work with the LayerView.

ArcGIS API for JavaScript Sandbox 

View solution in original post

1 Reply
ReneRubalcava
Frequent Contributor

You can set something up to change the visibility of the LayerView that manages the Layer. This visible property is independent of the source Layer visibility.

FeatureLayerView | API Reference | ArcGIS API for JavaScript 4.7 

This samples shows how to work with the LayerView.

ArcGIS API for JavaScript Sandbox 

View solution in original post