If it is a new group layer, I can specify the layers to include when creating a new group.like this:
{
_obj: 'make',
_target: [
{
_ref: 'layerSection',
},
],
from: {
_ref: 'layer',
_id: fromLayer._id,
},
using: {
_obj: 'layerSection',
name: groupName,
},
_isCommand: true,
_options: {
dialogOptions: 'dontDisplay',
},
}
or by DOM API document. createLayerGroup({fromLayers: [layer1, layer2], ...otherOption})
But if the group layer already exists, I don’t known how to do this.
I tried using Alchemist and drag a layer into group, and I got this:
{
"_obj": "move",
"_target": [
{
"_ref": "layer",
"_enum": "ordinal",
"_value": "targetEnum"
}
],
"to": {
"_ref": "layer",
"_index": 10
},
"adjustment": false,
"version": 5,
"layerID": [
44
],
"_isCommand": true,
"_options": {
"dialogOptions": "dontDisplay"
}
}
I guess to._index
is the group index that batchPlay
need, but, how can I get the index
field of the group?
any suggestions?