-
Notifications
You must be signed in to change notification settings - Fork 0
LayerGroup
Will Breitkreutz edited this page Feb 1, 2024
·
3 revisions
Not an actual layer type, but gives you the ability to group layers and manage visibility at the group level, useful for adding layers when using the LayerTree.
import { LayerGroup } from "@usace/groundwork-geo";
new LayerGroup(options)
Name | Type | Default | Description |
---|---|---|---|
id |
string | undefined |
A unique identifier for the layer, should be unique per map canvas. |
name |
string | "" |
The name of the layer shown to the user when exposed via the tree view UI. |
children |
array | [] |
Layers or LayerGroups to nest below this LayerGroup in a tree view. |
visible |
boolean | true |
Default visibility of the layer group |
expanded |
boolean | true |
Default expanded state of the layer group in a tree |
toggleable |
boolean | false |
If true, will add a checkbox to the tree item allowing the user to toggle the visibility of all children of the group |
add(layer)
Add a Layer to the layer group. Useful for adding children after instantiating the group, otherwise include the layers in the children
option.
Arg | Type | Description |
---|---|---|
layer |
Layer | (required) Layer to be added to the group |
remove(layer)
Removes the Layer from the children
array and removes it from the map.
Arg | Type | Description |
---|---|---|
layer |
Layer | (required) Layer to be removed from the group |
show()
Show all children of the group on the map.
hide()
Hide all children of the group on the map.
toggle()
Toggle the current visibility of each of the children of the group.
Make all children of the Layer Group visible on the map.
Core Components
Utilities
Toolbar Stuff
Sidebar Stuff