AnsweredAssumed Answered

Converting Json Data to Feature Layer

Question asked by antonantonenko on Jul 6, 2017
Latest reply on Aug 23, 2017 by rscheitlin

Hello everyone! 

 

I'm new to Javascript API, but its mostly straight forward with the documentation, however I'm having trouble converting JSON data to a Feature Layer. Now I referred to the reference documents but it seems like I'm missing something. 

So the idea is we creating our own API on the web server, and fetching the data when needed (of course in JSON format), like this:

 

{ id: 1, Company Name: "1670143 Ontario Inc.",

# of Local Employees: 2.5,

Address: "204LebretonStreetNorth Ottawa,OntarioK1R7J1 Canada",

Business Description: "We bring the Internet of All Things to a meaningful conclusion...right in the palm of your hand.", Company Age: "years", Industry: "Software, Cloud and SaaS", Phone: "(613)878-1135"

},

{ id: 2, Company Name: "2CI Technologies Inc",

# of Local Employees: 2.5,

Address: "1678Canemorecrescent Ottawa,OntarioK4A1S8 Canada",

Business Description: "Health and wellness IT development",

Company Age: "20 years",

Industry: "IT Consultants and Software Services", Phone: "(613)834-8144"

},

...

 

 

now when im trying to convert the JSON Object with:

var flRenderer = rendererJsonUtils.fromJSON(json_object);

 

i get null

 

 

Did anybody stumbled upon this issue before? 

 

 

 

P.S.

Im working version 4.4 of the API. 

Outcomes