Tell me more ×  I am able to obtain the features of the layer
which is selected by the user in the Layers table and then
intersected by a user defined polygon, using e.features. I was
able to obtain the attribute values of the feature as a
property, like this e.features[0].attributes.Family or
e.features[0].attributes.Species. The e.features[0].attributes
object looks like this, Object { Family="Pinaceae",
Species="Pinus cembroides"}.  Now the problem that I am facing
is when a user selects a different layer, say states, the
attributes properties change, the object now looks like this,
Object { STATE_NAME="Arizona", STATE_FIPS="04",
SUB_REGION="Mtn", more...}. So now I need to fetch the attribute
data by again changing the properties, like
e.features[0].attributes.STATE_NAME.  So I am trying to create a
common function where I can obtain the properties of the
attributes object and then directly fetch the values for any
layer. This is the code that I am trying to implement,  var
attrData = [];     //Work on ho