Features to pass to jimu SelectionManager class

01-31-2020 03:36 AM
New Contributor III

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": [


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?

Why do I have to pass geometry too, if the OBJECTIDs might be enough?

Could be better select them from an array of OBJECTID?

Thanx in advance


0 Kudos
1 Reply
MVP Esteemed Contributor


   That function is expecting an array of Graphic objects and that the layer exists in the map already. So you need to use the Graphics class from json constructor .


0 Kudos