Select to view content in your preferred language

Custom Widget in Exb- Dynamic Layers

123
1
2 weeks ago
gis6
by
New Contributor

Hello, I am using ArcGIS Experience Builder Developer, and I am ultimately trying to have 2 maps linked to a third. For example, if the first layer is toggled on or visible in the first map, and the first layer is toggled on or visible in the second map, then the corresponding layer is shown in the third map. There are 4 layers in map 1, 5 layers in map 2, and 20 layers in map 3. I have code that makes this possible in developer in the editor pane, but does not actually generate anything in the screen itself. Is this possible to do? I am trying to avoid the filter function, as I am trying to make this as user friendly as possible. Thank you!

Tags (2)
0 Kudos
1 Reply
Allen_Zhang
Frequent Contributor

There are 3 maps 1, 2 and 3.

If user toggles on layer A in map 1, and toggles on layer B in map 2, then the layer C in map 3 will be toggle on automatically.

Is this what you want?

If so, you can use JimuMapViewComponent to get the active map view.

<JimuMapViewComponent useMapWidgetId={useMapWidgetId} onActiveViewChange={onActiveMapViewChange} />

Then you get the layerView with jimuMapView.jimuLayerViews[viewId].view.

With the layerView, you add a handle to watch the layerView's visible and take according actions: 

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#addHa...

 

 

0 Kudos