AnsweredAssumed Answered

How to add a graphic with geojson string?

Question asked by gyy9911 on Mar 28, 2020
Latest reply on Apr 1, 2020 by ckoenig-esristaff

Hi

I'm using Arcgis API for JS 4.14,it provides GeoJSONLayer to add geoJSON data from url, just like this:

var geoJsonLayer1 = new GeoJsonLayer({ url: "http://www.myCorsEnabledServer.com/canada.json" });

However, my data and geo information is stored in MS SQL server,ever single record has a GeoJSON string, like {"type":"Point","coordinates":[119.84039205155467,32.309760149806948]}, I can't load it directly by GeoJSONLayer because there are no urls.

I think I can read the GeoJSON strings and creat graphics for each record, but how? Is there any way to convert GeoJSON string to graphic?

 

Outcomes