Toggling layers on and off

145
10
11-23-2022 08:44 AM
SaadullahBaloch
Occasional Contributor III

Let's say I have two layers (two link map layers (Indegree and Outdegree) created by Insights) in a single map. In the final shared page/workbook (as image i.e. no data access to the user) I would like the user to have the option to toggle one layer on at  a time, as I don't want them to be shown together.  

Tags (3)
0 Kudos
10 Replies
Scott_Aulen
Esri Contributor

@SaadullahBaloch,

You could use Predefined Filters to accomplish something that is functionally the same.

This map has two layers and I've added the appropriate filters to toggle each layer. Clicking on one of the layer filters will remove the other layer from the map.

Scott_Aulen_0-1669224414853.png

 

Scott_Aulen_1-1669224460588.png

 

 

 

 

 

0 Kudos
SaadullahBaloch
Occasional Contributor III

Good day Scott,

Nice to see you again, so if you look below, you will see that the layer on the map is not in the contents pane, so I don't know how to bring it to a predefined filter. 

 

SaadullahBaloch_0-1669224762486.png

 

0 Kudos
Scott_Aulen
Esri Contributor

Are these two layers different?

Scott_Aulen_0-1669226414454.png

 

Can you send a screenshot of the model view?

0 Kudos
SaadullahBaloch
Occasional Contributor III

No the layer in the map was created from the layer pointed at in the contents pane.

 

SaadullahBaloch_0-1669228626086.png

 

0 Kudos
SaadullahBaloch
Occasional Contributor III

And highlighted are the columns used to create the link map, by selecting them and then dragging them over the map which then creates the layer seen in the first screenshot.

 

SaadullahBaloch_1-1669228754293.png

 

0 Kudos
Scott_Aulen
Esri Contributor

Ok, I'm only seeing one link map layer in your map though.

Are you trying to create two link map layers? One styled with Indegree and another styled with Outdegree?

0 Kudos
SaadullahBaloch
Occasional Contributor III

Yup, and so the map will have two layers for inflow and outflow. Right now these two layers are based on two separste datasets.

0 Kudos
Scott_Aulen
Esri Contributor

You should be able to add a filter value for each layer into one Predefined filter. You may need to add a placeholder value for each layer where every record is the same so you can create the filter value.

 

For example:

-On Predefined Filter, add filter from Inflow layer where <Field you created> = <Value you created>. Rename to Inflow

-Do the same for Outflow layer

-Use the Single select appearance for the filter.

 

Whenever a users selects the Inflow filter value they are being shown all of the Inflow layer, essentially removing the Outflow, and vice versa.

Does that address what you're trying to do here?

SaadullahBaloch
Occasional Contributor III

Hi Scott,

Thanks for the quick response, I am off Thankgiving break, so I will let you know on Monday.

Happy Thanksgiving!

0 Kudos