Hi. I recently encountered the same issue, where any array property values in my geoJSON weren't getting pulled into my Feature Layer, and I was unable to access them in my popups. After revisiting the documentation, I think herein lied our problem:
[From the docs:] "Each GeoJSONLayer will only accept one schema of the properties. The fields property can be used to specify the desired fields for the layer. If fields is not defined, the schema used by the first feature will be used to deduce the fields schema for the layer."
To remedy this, I declared field types for all of my geoJSON properties just to be safe, and for the fields with array values, I specified them as strings in hopes that the API would convert them to strings, and it worked.
// GeoJSON snippet:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -1.149170, 52.955120 ]
},
"properties": {
"name": ["array", "of", "values"]
}
}
// GeoJSON layer setup:
const geoJSONLayer = new GeoJSONLayer({
url: URL.createObjectURL(blob),
renderer: renderer,
popupTemplate: template,
outFields: ["*"],
fields: [
new Field({
"name": "arrayField",
"alias": "Array Field",
"type": "string" <==== this will join the offending array into a string
})
]
});
Now, I can't say whether this is the recommended way of doing this since the API will still warn you in the console about invalid field types. However, none of the other available field types seem appropriate for outputting arrays, and while it feels a little messy, it will get your array property values to populate. Just be sure to require() the Fields module first, or you can use the autocasted implementation and skip the require().
If anyone else knows of a cleaner way (or why GeoJSONLayers are incapable of outputting array-type geoJSON properties in the first place), please chime in!