Select to view content in your preferred language

Provide way in Map Viewer to hide a layer in layer lists

959
4
05-08-2023 11:56 AM
Status: Open
rmcooper_wcpss
Occasional Contributor

Currently the Map Viewer provides a useful option to hide layers in legends. However, toggling that setting in Map Viewer does not remove the layer from being toggled in a layer list in derivative applications.

There are cases where it would be helpful to have a layer as a part of the map that is both excluded from the legend and a layer list in derivative applications. The blend modes functionality provides a useful example. Say I create a Sketch layer and draw a circle around an area of interest. I can use blend modes on the Sketch layer to mask, for example, the basemap so only the area in the circle is visible (See animation below). 

agol-sketch-context-example-1.gif

In this case, for derivative applications, I would not want users to be able to toggle the Context Mask layer off. However, when I use this map in the Basic Instant App, Context Mask is among the togglable layers in exposed by the LayerList widget.

agol-sketch-context-example-2.gif

Examining the ArcGIS Maps SDK for JavaScript documentation, I found that there is a listMode property on the Layer class that enables you to set at the individual layer level if a layer should be shown in a LayerList.

I do suspect that since the LayerList widget is used as the layer toggling interface in the MapViewer that it is not so simple as exposing the listMode property in the layer properties UI. However, it would be helpful to be able to store a list of layers in the JSON the MapViewer generates that should be hidden in derivative applications. I also recognize there would be downstream impacts in InstantApps and other places. Finally, I know that the simple presence of the listMode property on each layer means I can achieve my suggestion here with a custom application. I may just do that! I'm just suggesting it would be helpful to have the same level of control over what layers appear in layer lists as what appears in legends.

4 Comments
wayfaringrob

Yes! For the same reasons you state I would find this handy: being able to hide graphic trickery, and to simplify the layer list/restrict what users see/have control over.

RussRoberts

We currently do not have plans to bring this into Map Viewer and listmode is not in the web map spec. This layer list configuration we think could be exposed in one of the authoring web apps like instant apps or experience builder to be able to set it on a layer. 

 

Thanks!

Russ

rmcooper_wcpss

Thanks @rrush . What you're saying makes sense and as I was writing the Idea it occurred to me that the authoring web apps might be a more appropriate place for this feature. Just figured I'd get what i'd come up with out there and see what folks thought.

I think the expanded visual possibilities afforded by blend modes make this idea more than just a solution to a niche corner case. It makes this great feature more useful in production applications. For the app I used in the examples in my post, I had to tell my end-users to not toggle specific layers in the LayerList. Because it was a disposable, internal app used by only a couple people it's not a huge deal, but I would not deploy it to a larger user-base. I'm providing a sloppy user-experience telling users to keep their hands off of things they technically can touch. That's not something I want to bring to a larger audience because it takes away some of the professional polish that app builder applications convey. For now if I want to get the granularity of control I'm after I'll just create a custom app with ArcGIS Maps SDK for JavaScript.

Would it be advisable to rework the idea focusing on implementation in authoring web apps?

RussRoberts

Yup, would recommend posting it in the instant app and/or experience builder space. I will fwd it along to the team as well. 

Thanks!