Turn on/ off specific layers in Experience Builder when switching views

1272
6
08-18-2020 05:55 AM
Status: Open
AFackler_NAPSG
New Contributor III

In StoryMaps (Specifically the tabbed storymap), there is a function that allows you to decide which layers turn on/off depending what tab you are in while maintaining the same map extent. It would be helpful to have this same functionality in Experience Builder when switching between views. An example of our work that we would like to port to Experience Builder can be found here (Be sure to go to the hazard exposure pages to see the tabbed story map): https://napsg.maps.arcgis.com/apps/MapJournal/index.html?appid=261d020c1ec941618e6f338dd127d566 . Notice how the extent stays the same but layers turn on/off depending on what tab you are in. This functionality would cut down on development time and maintenance time would be largely reduced because we won't have to maintain as many web maps.

6 Comments
by Anonymous User

I agree with this 100%. The functionality could be (possibly?) integrated into the "set custom map extent" interface within the map widget panel. Similar to the "bookmark" widget in a web app, I imagine being able to not only set a custom map extent, but to also be able to check on/off certain layers. I would use this functionality in conjunction with views. Currently, I have to create a separate web map for every view I want to use, whereas with this functionality I would only need to create one web map with all the data layers, and customize the layer visibility for each view.

DavidRasner1

I would like to see this as well. Being able to control layers with a button would make it possible to create interactive maps with different legends and topics.

TommyDSM

Yes, this would be a very helpful and useful enhancement.  The ESRI customer support just summited an internal enhancement request for this very issue.

Jianxia

@AFackler_NAPSG @TommyDSM and all, you can add the same map multiple times to the Data Tab in Experience Builder as separate data sources. For example, the Air Quality Trend map is added twice to the Data tab as two web maps which is then renamed to Air Quality Trend 1 and Air Quality Trend 2 respectively as shown below. Click each web map, turn off /on the layers in the map data source as highlighted, then use Map widgets to connect to each map data source with the layer visibility defined in the above step. In this way, you only maintain one map with multiple map data sources.

 2022-01-14_17-03-21.png2022-01-14_17-04-27.png

TonghuiMing
JohnNerge1

This is cool and all, but back to the original poster's idea, it'd be nice for this experience (no pun intended) to be consistent with that of story maps. When I think about controlling map layer visibility, I think it'd be more logical to be able to do that at the Widget level than the Data Source level.

It might be a six of one half dozen of the other situation, but but I think it'd be more intuitive, even if the best I can explain it is, "It just makes sense that way." Maybe it's because adding the same map multiple times could get really confusing if you have more than one web map in your app. Then you're in a situation where you're not really sure how many truly unique web maps you're linking to, versus if you just add the map once and configure it differently within the app your data sources list truly reflects the unique maps you're connected to.

I'll stop now because I feel like I'm talking in circles, but if anyone feels the same and can express it better please do!