I get FeatureQueryResult from gpkx and I can create a FeatureColleciton Layer without problems. The issue I have is to add more attributes to the layers, i.e. add Field to Table of featureCollection.Tables. Is there a way to do this? Or create a new FeatureCollectionTable from the existing one to generate a new FeatureCollectionLayer?
Fields in FeatureCollectionTable are defined by fields that are in FeatureQueryResult. There is no way to add attributes to a FeatureCollectionTable after the fact.
I found a way. You create a new FeatureCollection from the original FeatureCollection. For each table, you replicate the existing fields and add new Fields. Create a new FeatureCollectionTable. For each Feature, you add new Field attributes and add to this new FeatureCollectionTable. Then create FeatureCollectionLayer from this.