-
Notifications
You must be signed in to change notification settings - Fork 10
Layer Groups
A layer group refers to a group of layers which are sorted together based on a similar topic or theme. For instance, the base application configuration includes the land cover and land cover dynamics layer groups which contain global GFW data layers. The base configuration also includes a webmap group which pulls all the layers from your ArcGIS Online webmap. If the ArcGIS webmap is empty the user web map group will be excluded from the app. Users may only have one webmap group so will need to use advanced configuration options when building a map with multiple custom groups. Users have the ability to customize existing layer groups or add custom layers groups containing user defined data. For instance, a user may wish to add a layer group with national data on Land Use or Biodiversity. Custom groups are object defined based on a unique key. The layer group configuration parameters are listed below:
Property | Explanation | Data type | Example |
---|---|---|---|
GroupType | Specifies the type of layer group:
|
string | "groupType": "checkbox", |
order | Specifies the order of the layer group in the layer tab | Numeric | "order": 4, |
label | Contains a list of label objects | Label Objects | "label": {"en": "Protected Areas","fr": "Zones protégées","sp": "Áreas protegidas"}, |
layers | Contains a list of layers contained inside the layer group | Layer List | See layers page |
There are currently three types of layers to choose from. If you do not specify a type then the application will default to checkbox.
-
checkbox - This is a standard group type with checkboxes to turn layers on and off. With this group type, more than one layer may be on at a time
-
radio - This group contains raio buttons instead of checkboxes for the layer toggles. Only one layer may be on at a time within the same group. You may optionally choose to turn this group off when any other radio group is selected
-
nested - This group allows for layers to be grouped further within a layer panel within an existing layer group as shown in the screenshoot below. Click here for more information on how to create nested layers.
The .json snytax below provides an example of a layer group, with "GROUP_PA" as the unique layer object key. In this case, Group_PA is a unique layer object key to refer to a group which contains layers about protected areas. This layer group will appear third in the layer panel, and the type is radio. Label names are included in French, English, and Spanish.
"GROUP_PA": {
"order": 3,
"groupType": "radio",
"label": {
"en": "Protected Areas",
"fr": "Zones protégées",
"sp": "Áreas protegidas"
},
"Layers":[...]
The layer group contains layers. For information on layer configuration click here.