Group Layer (GroupLayer)

GroupLayer provides the ability to organize several sublayers into one common layer. Suppose there are several FeatureLayers that all represent water features in different dimensions. For example, wells (points), streams (lines), and lakes (polygons). The GroupLayer provides the functionality to treat them as one layer called Water Features even though they are stored as separate feature layers.

With respect to layer blending, sublayers of a group layer are blended together in isolation, separate from layers outside that group layer. When blendMode is specified for a group layer, the group's collective content is blended with the layer underneath.

With respect to scale visibility, sublayers of a group layer will be visible only within the scale range defined for the group layer. A sublayer may further restrict itself to a narrow scale range. In other words, a sublayer will be visible only when the current map scale intersects the scale range of that sublayer as well as the scale range of all its parent group layers.

Referenced by: operationalLayers

Properties

Property Details
blendMode Blend modes are used to create various effects by blending colors of top and background layers. normal blend mode is the default.
Valid values: average, color, color-burn, color-dodge, darken, destination-atop, destination-in, destination-out, destination-over, difference, exclusion, hard-light, hue, invert, lighten, lighter, luminosity, minus, multiply, normal, overlay, plus, reflect, saturation, screen, soft-light, source-atop, source-in, source-out, vivid-light, xor
effect Effect provides various filter functions to achieve different visual effects similar to how image filters (photo apps) work.
id A unique identifying string for the layer.
itemId Optional string containing the item ID of the group layer if it's registered on ArcGIS Online or your organization's portal.
layers[] List of child operationalLayers
layerType String indicating the layer type.
Valid value of this property GroupLayer
maxScale A number representing the maximum scale at which the layer will be visible. The number is the scale's denominator.
minScale A number representing the minimum scale at which the layer will be visible. The number is the scale's denominator.
opacity The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.
title A user-friendly string title for the layer that can be used in a table of contents.
visibility Boolean property determining whether the layer is initially visible in the web map.
visibilityMode Defines how visibility of sub layers is affected. If set to 'exclusive', clients should ensure only one sublayer is visible at a time. If set to 'independent', clients should allow visibility to be set independently for each sublayer. 'independent' is default.'
Valid values:
  • exclusive
  • independent
visibilityTimeExtent Represents time extent that will control when a layer should be visible based on webmap's current time. Visibility time extent only affects the layer visibility and will not filter the data.

group Layer - independent visibility mode Example

{
  "id": "groupLayer",
  "layerType": "GroupLayer",
  "maxScale": 144447,
  "minScale": 0,
  "opacity": 1,
  "title": "US Census",
  "visibility": true,
  "layers": [
    {
      "id": "Census_6999",
      "title": "Census - states",
      "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3",
      "layerType": "ArcGISFeatureLayer",
      "visibility": true
    },
    {
      "id": "Census_616",
      "title": "Census - Detailed Counties",
      "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2",
      "layerType": "ArcGISFeatureLayer",
      "visibility": true
    }
  ]
}

radio group layer - exclusive visibility mode Example

{
  "id": "groupLayer",
  "layerType": "GroupLayer",
  "maxScale": 144447,
  "minScale": 0,
  "opacity": 1,
  "title": "US Census",
  "visibility": true,
  "visibilityMode": "exclusive",
  "layers": [
    {
      "id": "Census_6999",
      "title": "Census - states",
      "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3",
      "layerType": "ArcGISFeatureLayer",
      "visibility": true
    },
    {
      "id": "Census_616",
      "title": "Census - Detailed Counties",
      "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2",
      "layerType": "ArcGISFeatureLayer",
      "visibility": false
    }
  ]
}

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