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

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.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(layers: Iterable<Layer> = mutableListOf())

Creates a group layer object with child layers.

Properties

Link copied to clipboard

The child layers associated with a group layer.

Link copied to clipboard

Determines if the child layers should be shown in the map legend.

Link copied to clipboard

The visibility mode for the layers in a table of contents.

Inherited properties

Link copied to clipboard

The attribution text for the layer.

Link copied to clipboard
open override val canChangeVisibility: Boolean

A flag indicating whether the layer content's visibility can be changed. A flag indicating whether the layer content visibility can be changed. Will return false if an error occurs.

Link copied to clipboard

The description for the layer.

Link copied to clipboard

The full extent of this layer, which is the extent where all layer data is contained. You can use this to zoom to all of the data contained in this layer. For feature layers, the extent is retrieved from its com.arcgismaps.data.FeatureTable.extent.

Link copied to clipboard
var id: String

The unique identifying string for the layer, as specified in a map or scene. The id is used by other parts of this API to refer to a specific Layer, such as in a set of com.arcgismaps.geotriggers.FeatureFenceParameters or a com.arcgismaps.mapping.floor.FacilityLayerDefinition. If not supplied, all layers will be assigned a unique id when created.

Link copied to clipboard

True if the layer supports identify, false otherwise. The value of this property may not be correct until the layer is in a fully loaded state.

Link copied to clipboard
open override var isVisible: Boolean

The layer content's visibility. The layer content visibility. Will return false if an error occurs.

Link copied to clipboard
val item: Item?

The item the layer has been created from.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Link copied to clipboard

The maximum scale for the layer. The maximum scale at which this layer is visible. If the map or scene is zoomed in beyond this scale, the layer will not be visible. A value of 0 means there is no maximum scale threshold and the layer will be visible at the smallest scale available for the map or scene. If the value is nil, there is no maximum scale. All of the connected map and scene views will be updated.

Link copied to clipboard

The minimum scale for the layer. The minimum scale at which this layer is visible. If the map or scene is zoomed out beyond this scale, the layer will not be visible. A value of 0 means there is no minimum scale threshold and the layer will be visible at the largest scale available for the map or scene. If the value is nil, there is no minimum scale. All of the connected map and scene views will be updated.

Link copied to clipboard
open override var name: String

The name of this layer.

Link copied to clipboard

The opacity for the layer. The opacity of this layer as a value between 0 (fully transparent) and 1 (fully opaque). The default opacity value is 1.

Link copied to clipboard
open override var showInLegend: Boolean

A flag indicating whether the layer content participates in the legend. A flag indicating whether the layer content is shown in the legend.

Link copied to clipboard

The spatial reference of the layer.

Link copied to clipboard
open override val subLayerContents: StateFlow<List<LayerContent>>

The sub layer contents of a layer content.

Link copied to clipboard
val visibilityChanged: SharedFlow<Boolean>

A SharedFlow that emits when the visibility of the layer changes.

Functions

Link copied to clipboard
open override fun clone(): GroupLayer

Clones the GroupLayer.

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open suspend override fun fetchLegendInfos(): Result<List<LegendInfo>>

Fetches the list of legend info.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isVisibleAtScale(scale: Double): Boolean

Returns the layer content's effective visibility at the specified scale. Returns the effective layer content visibility. This effective visibility takes care of the effective visibility of the parents at the specified scale. Will return false if an error occurs.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.