Select to view content in your preferred language

Can you link 2 layers so that one appears only when another is visible?

747
8
09-16-2024 03:38 AM
ttw_marine
Emerging Contributor

I would like to link 2 layers so one of them only appears if the other one is visible. I want to avoid merging the layers. Layer 1 is of project boundaries, Layer 2 is of cables for the projects. I only want the Layer 2 to appear when Layer 1 is visible.

The content is used in a Dashboard map, where various Serial Charts are running from Layer 1. Actions are used to filter the Layers on the map. I would like the link between the Layers to be used in the Actions on the Dashboard too, so when a category is selected, the map filters Layer 2 as well as Layer 1.

I wondered if this might be possible with some sort of Join? Can this be applied in Web Maps?

I hope that makes sense. Thanks in advanced for any help!

0 Kudos
8 Replies
Nick_Creedon
Frequent Contributor

In dashboards --> Element Settings--> Actions --> Filter

Setting actions for your layers you can check the box "Render only when filtered"

This will only display the layers when you properly filter/search for them.

This only works with certain elements, but it sounds like you are using one that is.

 

In web maps for visual appeal you can set extents for these layers so that are viewed from the same extent in your web map and dashboard.

0 Kudos
KimOllivier
Honored Contributor

If you put both feature layers into a FeatureLayerCollection then you can turn them both on or off together.

0 Kudos
Nick_Creedon
Frequent Contributor

Yes, this would work well too. Since your layers are separate you can group them In Map Viewer, in layer contents you will see 3 dots, click those dots and a menu will popup, click group and you can drag and drop your desired layers into the same group and you can set individual extents or they can share the same extents, same goes for turning the layer(s) on an off.

Nick_Creedon_0-1726669062406.png

 

0 Kudos
AmySnelgrove1
Emerging Contributor

Can this be done with live data?  I have a feature class of kayak launch sites in a category selector and am trying to have USGS live stream gauge data appear when the launch sites are filtered in the category selector.  The live data has caused an issue with everything I've tried.  Any ideas would be greatly appreciated!

0 Kudos
Nick_Creedon
Frequent Contributor

Live data should work, a good example were all of the covid dahsboards showings cases in the country. I'm trying to understand what the issue may be on your end. For the filters to work properly the data needs to be filled out correctly so the filters will work, I had to get creative an make special fields to work around my issue in how I wanted to filter data.

0 Kudos
AmySnelgrove1
Emerging Contributor

I have a category selector that allows you to select between various nature activities (in different layers).  When I select an activity in the category selector, the features appear in the map. 

AmySnelgrove1_0-1743530265383.png

The category selector uses a field that is similar between all the feature classes/layers for nature activities. When I select kayak launches to appear in the map, I want the live stream gauge data to appear.  My issue is that I can't add that field to the stream gauge data because it loses its "liveliness".  Grouping stream gauge and kayak launch layers didn't work. Is there a way to get the live stream gauge data to appear in the map when you select Kayak launches? I've tried Grouping launches to the live data, but that didn't work.  I hope that's clearer.   

0 Kudos
Nick_Creedon
Frequent Contributor

I'm wondering if your layer is not refreshing in your webmap which translates to the dashboard. 

This link has an example of point features, but the settings to enable refresh interval are here too.

https://community.esri.com/t5/arcgis-dashboards-blog/dashboards-that-pop-refresh-intervals/ba-p/1540... 

0 Kudos
ttw_marine
Emerging Contributor

Thank you both @Nick_Creedon & @KimOllivier , good suggestions. I have tried both but for what I'm looking for in this case, I think the easiest thing is to keep the cables turned off all together. I didn't explain very well in my original post, but each cable has a unique ID which matches the relevant project's unique ID. Ideally, I'd like it to be the case that when a particular project is selected, either on the Map or through an Action via a chart, the cables for that project also appear. If not selected or filtered, cables do not appear.

I've included some screenshots showing how currently, when filtered using a Serial Chart action, the cables for a project remain despite the project being filtered. It's tricky because the attribution is different in the cables feature class, the only info in common is the Unique ID, which i wonder if I could use to link them.

The 'Render only when filtered' option looked good, but once columns on serial charts were selected, ALL cables appeared on the map, even for projects that were not filtered. 

I think I'll leave cables turned off as default, and users can choose to turn them on when interrogating a particular project as needed. Thanks for your suggestions!

0 Kudos