GroupLayer Class

  • GroupLayer
  • class Esri::ArcGISRuntime::GroupLayer

    A layer that is a container for other layers and group layers. More...

    Header: #include <GroupLayer.h>
    Since: Esri::ArcGISRuntime 100.5
    Inherits: Esri::ArcGISRuntime::Layer

    Public Functions

    GroupLayer(const QList<Esri::ArcGISRuntime::Layer *> &layers, QObject *parent = nullptr)
    virtual ~GroupLayer() override
    bool isShowChildrenInLegend() const
    Esri::ArcGISRuntime::LayerListModel *layers() const
    void setShowChildrenInLegend(bool show)
    void setVisibilityMode(Esri::ArcGISRuntime::GroupVisibilityMode mode)
    Esri::ArcGISRuntime::GroupVisibilityMode visibilityMode() const

    Detailed Description

    A GroupLayer 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.

    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.
    • 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 merges 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].

    Member Function Documentation

    [explicit] GroupLayer::GroupLayer(const QList<Esri::ArcGISRuntime::Layer *> &layers, QObject *parent = nullptr)


    • layers - The initial set of child layers to be part of this group's collection of layers.
    • parent - The parent QObject.

    [override virtual] GroupLayer::~GroupLayer()


    bool GroupLayer::isShowChildrenInLegend() const

    Returns whether the child layers of the group layer should be shown in the map legend.

    See also setShowChildrenInLegend.

    Esri::ArcGISRuntime::LayerListModel *GroupLayer::layers() const

    Gets the list of child layers.

    Changing the contents of this model will also change the contents of the group layer.

    void GroupLayer::setShowChildrenInLegend(bool show)

    Sets whether the child layers of the group layer should be shown in the map legend.

    • show - A true value indicates that the child layers should be shown in the map legend. The default value is true.

    See also isShowChildrenInLegend.

    [since Esri::ArcGISRuntime 100.9] void GroupLayer::setVisibilityMode(Esri::ArcGISRuntime::GroupVisibilityMode mode)

    Sets the mode on indicating how the participating layers within a GroupLayer should be displayed in a table of contents.

    The default is GroupVisibilityMode::Independent.

    This function was introduced in Esri::ArcGISRuntime 100.9.

    See also visibilityMode().

    [since Esri::ArcGISRuntime 100.9] Esri::ArcGISRuntime::GroupVisibilityMode GroupLayer::visibilityMode() const

    Returns the mode indicating how the participating layers within a GroupLayer are displayed in a table of contents.

    The default value is GroupVisibilityMode::Independent.

    This function was introduced in Esri::ArcGISRuntime 100.9.

    See also setVisibilityMode().

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.