I'm generating and adding graphics to a client-side feature layer, but, after the LayerView updates, I cannot query on all of its attributes--only on its OBJECTID. Why am I not getting any other attributes?
To the "Create a FeatureLayer with client-side graphics" example, I have added the following snippet in addToView(). (See Codepen.)
Assert > 1 availableFields false
_Any_ graphics have an 'OBJECTID' attribute true
_Any_ graphics have a 'url' attribute false
I expected to see availableFields having a length of 2 and to find "url" attributes in the query results.
Solved! Go to Solution.
You'll need to add the outFields parameter to your layer's constructor:
outFields: ["OBJECTID","url"],
This is somewhat implied by the documentation for the availableFields property.
You'll need to add the outFields parameter to your layer's constructor:
outFields: ["OBJECTID","url"],
This is somewhat implied by the documentation for the availableFields property.