Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a functionality that creates array data for any layer that user selects. Now I am able to get all the data in the feature layer that the user selects but I am having some trouble with the ArrayReader to which I need to assign the field names of the feature data.

So this is field collection loop,

for (var prop in e.features[0].attributes) { attrfields.push(prop); }

As of now I am hard coding the ArrayReader like this,

var myReader = new{},[
                    {name: 'family'},
                    {name: 'species'}

I need to replace,

[{name: 'family'}, {name: 'species'}]

with the attrfields, which looks like this,

[Object {"Family"}, Object {"Species"}]

Now am confused as to how I should create attrfields to replace it in the ArrayReader? Any suggesstions?

share|improve this question
up vote 0 down vote accepted

This was the solution,

I needed to create the columns fields separately and then add the attrfields to the ArrayReader.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.