FeatureLayer.fromJSON()

468
2
Jump to solution
09-22-2022 05:23 AM
MatthieuThery1
Occasional Contributor

Hi,

 

Is it possible to instantiate a FeatureLayer from a JSON coming from the server (4.X)?

From the types it looks like it should be possible:

MatthieuThery1_0-1663849345628.png

But sadly it tells me the function does not exist.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

As you guessed, it is not possible to create FeatureLayer directly from the JSON object at the moment. We have a plan to add support for this, however, I do not know what the timeline is. 

View solution in original post

2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

As you guessed, it is not possible to create FeatureLayer directly from the JSON object at the moment. We have a plan to add support for this, however, I do not know what the timeline is. 

MatthieuThery1
Occasional Contributor

By the way I found a way-ish to create a Feature Layer from a JSON object. I'm using an interceptor to intercept the endpoint request and return the JSON at that point. It allows us to bypass the endpoint call everytime we mount the layer.

0 Kudos