Controling scene layers with a button

832
6
08-13-2021 10:36 AM
Labels (1)
DavidRasner1
New Contributor III

Hello,

I'm wondering if there is a simple way how to control multiple layers (on/off).

I'm trying to give the user an option to switch between different legends and colors using a button.

Something like this:

DavidRasner1_0-1628875964934.pngDavidRasner1_1-1628875990317.png

DavidRasner1_2-1628876021745.png

All I need is a button to turn certains layers on and off. But I don't see a way without the API. 🤔

Tags (3)
0 Kudos
6 Replies
RussRoberts
Esri Notable Contributor

Can you load a web scene and have your layers combined into group layers? You can author this web scene with scene viewer and load it into experience builder.

DavidRasner1
New Contributor III

Thanks for the reply @RussRoberts 

I guess I could create multiple pages, or sections withs different maps, for different topics. That would be good enough for a demo.

But the way I see it, the proper way is a custom widget. I'm looking to get some help from a JS DEV.

I was hoping I can recreate the c-through demo: https://esri.github.io/c-through/

 

0 Kudos
mabat3D
New Contributor II

Hello David,

I would appreciate your help.
How did you manage to load a model for the filter widget? I'm trying to run a filter on the Scene Layer but I can't for some reason. The filter only works for me on the Feature Layer.

0 Kudos
RussRoberts
Esri Notable Contributor

To use filter with a scene layer it needs to be a scene layer published from a feature layer. We use the associate feature layer  to apply the query. If you publish from a scene layer package you wont have this filter option.

0 Kudos
mabat3D
New Contributor II

Thanks for the reply @RussRoberts 

How I publish scene layer from a feature layer? share as a web layer?

it is a rvt file. I need  convert it to gdb before or directly ?

0 Kudos
RussRoberts
Esri Notable Contributor

Building scene layers are different from 3D Object scene layers in this case. You can have a building scene layer with an associate feature layer when published from Pro and this allows you do do edits to the BSL and do rebuilds to pick up those changes in the scene layer cache. The BSL uses the building explorer widget to filter out different sections which doesn't require an associate feature layer.

0 Kudos