I have a GeoJSONlayer which I need to update occasionally with new features from a fetch-request, triggered by the user. Using version 4.19.
The fetch response is also a GeoJSON which I can make into a GEOJSONlayer with the following:
However, I do not wish do make a new layer from the fetch response. I want to update my original GeoJSON layer with the features contained in the response. So I use applyEdits according to the following:
I have a working workaround, which is to create the NewGeoJSONLayer (which I don't want), query all features from that layer (which seems unnecessary since I want all features in my response_json) and then do the applyEdits with featureSet.features.
So, how can I use my response_json with applyEdits on my original layer directly? Thanks in advance for any help!
@JanHellenberg , If you upgrade to 4.22, you will be able to do what you are asking with the use of GeoJSONLayer.customParameters and GeoJSONLayer.refresh.
The section @RobertScheitlin__GISP referenced in his answer explains the updates we installed at 4.22 for CSV and GeoJSONLayers. The following video explains what this means.
This sample shows the updates in action.
Thanks and sorry for late reply, I had major issues updating from 4.19 to 4.22.
I have two questions: first, does the 4.22 GeoJSONLayer support POST method, which is required by the server in my case? I assumed that only GET is supported?
Secondly and related, in my example above I have parameters, headers and body which I send together with my Fetch POST request. How is the syntax for providing all these in the GeoJSONLayer properties, if possible at all?
I do something like this: