Sublayer visibility only reflects top level GroupLayer visibility?

737
6
10-07-2020 03:24 PM
JonathanRuland
New Contributor II

The visibility of GroupLayers is not behaving the way we would expect. We have a layer hierarchy that looks like this:

GroupLayer-->GroupLayer-->FeatureLayer

When we toggle on/off the visibility of the topmost GroupLayer all sub layers toggle on or off with it as expected. When we toggle on/off the FeatureLayers at the bottom of the hierarchy these also toggle on or off as expected. However, when we toggle on/off the middle GroupLayer I would expect all sub layers (a collection of FeatureLayers in our case) to toggle on or off with it, but instead nothing happens.

It would appear that the low level FeatureLayers are reflecting the visibility of the topmost GroupLayer and ignoring the visibility of the mid level group layer. Is this the expected behavior? If so, how can we get the bottom level FeatureLayers to reflect the visibility of the mid level GroupLayer instead?

0 Kudos
6 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

What version of the API are you referencing?

Thanks

Mike

0 Kudos
JonathanRuland
New Contributor II

100.9

0 Kudos
JonathanRuland
New Contributor II

do you have any insight on this?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

I have not been able reproduce using the preview Table of Contents control within the Toolkit for ArcGIS Runtime SDK for .NET (arcgis-toolkit-dotnet/TableOfContents.Theme.xaml at main · Esri/arcgis-toolkit-dotnet · GitHub).

Can you share the repro code?

Thanks

Mike 

0 Kudos
JonathanRuland
New Contributor II

thanks for getting back to me michael. it turns out there is a lot of code to post, and in the meantime we have come up with a potential workaround. i will first see if this workaround will suit our needs before asking you to spend more time looking into this. thanks again!

0 Kudos
dotMorten_esri
Esri Frequent Contributor

For the group layer, check the VisibilityMode property on the GroupLayer as that defines how visibility of sublayers inherits visibility of the group layer.

However, in general if a parent layer isn't visible, child layers won't be visible regardless of their visibility setting.

0 Kudos