I have a Web AppBuilder application, and I call a GeoProcessing Service to retrieve features to select.
Features come as follows (in a normal ESRI JSON).
{
"features": [
{
"attributes": {
"OBJECTID": 1051,
"CODE": "IT9140005",
"TYPE": "B",
"Name": "Lake S. John",
"AREA": "79781684.173",
"PERIMETER": "86058.177",
"HECTARES": "7978.168",
"SHAPE.AREA": 0.008503497389955931,
"SHAPE.LEN": 0.952023279018308
},
"geometry": {
"rings": [
[[18.580059000423375,41.79841200001471],
[18.59070999966758,41.824356000330056],
[18.627246000103696,41.815020999720275],
...
...
...]]
}
}
]
}
Now I need to select them from a layer by SelectionManager class as follows.
this.selectionManager = SelectionManager.getInstance();
this.selectionManager.setSelection(layerToSelect, myfeatures).then(() => {
/* do something */
});
What should myfeatures be?
Passing the the features of before it returns strange errors (related to something missing in features, spatial Ref, etc).
Which is the correct way to pass retrieved features to SelectionManager class, in order to select them?