Class GroupLayer
A container for other layers and group layers. It is used to represent datasets that are composed of multiple layers to be managed as a single layer with respect to display in a map or scene.
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class GroupLayer : Layer, INotifyPropertyChanged, ILoadable, ILayerContent
Remarks
Group layers are designed for presentation of operational layers that are related by a theme. You can add several related operational child layers into a group layer so the layers can be displayed together. Suppose there are several feature layers that represent existing infrastructure projects (buildings, sidewalks, roads, and trees). You can add these feature layers into a single group layer called "Existing". Similarly assume there are also proposed infrastructure projects that are features in other layers. These layers can be added to a group layer called "Planned". You can manage the visibility of the existing or planned features as separate groups.
For the most part, group layers behave like any other layer in that:
- A group layer has visual properties (visibility, opacity) that can be applied to all layers in the group layer at once. This is helpful when controlling the visibility of the group.
- You can set a scale range on a group layer using the minimum and maximum scale properties. If a child layer has more restricted scale range, that scale range will be honored for that child layer.
- A group layer may be queried for the aggregate geographic extent of its child layers.
- A group layer may be nested inside another group layer. There is no defined nesting level limit.
- Cloning a group layer will also clone its child layers.
- A group layer does not have its own attribute values. The text from the child layers is displayed instead.
- A group layer is not time-aware, but may contain layers that are.
- A group layer cannot be added to a basemap.
The full extent of a group layer is derived asynchronously based on what information is available from the child layers. This means the full extent can change when child layers are added or removed. The full extent geometry will have the spatial reference of the first loaded child layer.
Group layers are not supported in Web maps. Saving a map with a group layer to a web map flattens the operational layers. Group layers are supported in Web scenes.
The visual opacity property of the group layer affects the opacity of the child layers. The opacity of the child layers is a mathematical product of the individual child layer's opacity and the group layer's opacity. Opacity values range from 0.0 (transparent) to 1.0 (opaque). This means that setting the opacity of the group layer to 0.0 will make all child layers transparent [0 * AnyNumber = 0]. Likewise when the group layer opacity is 1.0, will set the opacity of the child layers to their individual layer opacity [1 * AnyNumber = AnyNumber].
Constructors
Name | Description |
---|---|
GroupLayer() | Initializes a new instance of the GroupLayer class. |
GroupLayer(IEnumerable<Layer>) | Initializes a new instance of the GroupLayer class with the child layers passed. |
Properties
Name | Description |
---|---|
Layers | Gets or sets the child layers associated with a group layer. |
ShowChildrenInLegend | Gets or sets a value indicating whether child layers should be shown in the map legend. |
VisibilityMode | Gets or sets the visibility mode for the layers in a table of contents. |
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.5 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.5 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.5 - 100.15 |
Xamarin.iOS | 100.5 - 100.15 |
UWP | 100.5 - 100.15 |