Experience Builder - How to Turn On/Off multiple layers

1603
7
Jump to solution
10-13-2020 02:46 PM
MarcoPoetsch
Occasional Contributor II

Hi all,

does someone of you know a good way to turn on/off multiple layers with one click using a button (or something)?

So basically I have a map with multiple layers (e.g. layers A, B, C, D).

On default only layer A should show.

When clicking button B, none but layer B should show.

If I click button C, only layer C should be activated, and so on...

Bookmarks won't work, because I don't want to change the map extent...

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DavidMartinez
Esri Regular Contributor

Hi Mario,

There is nothing out of the box that allows you to achieve this besides using the layers widget. What you're describing is something that can be created with a custom widget. We do have an issue in our repo on how to tie into the layers widgets from other widgets. You could use the section widget to achieve the workflow you're describing above.  Each section would have different maps with the correct layers already turned on. Then you could use the views navigation widget or button widget to switch between views. Then have an action for each map that basically zooms to the area. 

Cheers,

David

View solution in original post

0 Kudos
7 Replies
MarcoPoetsch
Occasional Contributor II

anyone any thoughts?

0 Kudos
DavidMartinez
Esri Regular Contributor

Hi Mario,

There is nothing out of the box that allows you to achieve this besides using the layers widget. What you're describing is something that can be created with a custom widget. We do have an issue in our repo on how to tie into the layers widgets from other widgets. You could use the section widget to achieve the workflow you're describing above.  Each section would have different maps with the correct layers already turned on. Then you could use the views navigation widget or button widget to switch between views. Then have an action for each map that basically zooms to the area. 

Cheers,

David

0 Kudos
MarcoPoetsch
Occasional Contributor II

Thank you David,

I tried that, but I'm experiencing some issues with the sync of the map extent. It works fine the first time, but when you switch back or go to the next section, it won't keep the map extent. Although I had setup the map actions for that.

0 Kudos
MarcoPoetsch
Occasional Contributor II

these are my settings:

This is what happens:

0 Kudos
DavidMartinez
Esri Regular Contributor

Can you remove the Pan to and only use the zoom to and see if that works?  We have an open issue on those two actions canceling one another out. 

MarcoPoetsch
Occasional Contributor II

Thanks David, that's working now

0 Kudos
TommyDSM
New Contributor II

a solution for this is badly needed.

 

0 Kudos