<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create Feature Layer from JSON in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-layer-from-json/m-p/297762#M27366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have create a java based tomcat web server with a REST endpoint to serve up JSON with point geometry. The output JSON which is a list of features in a class called Task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AJAX call looks like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;function &lt;/SPAN&gt;ajaxGetTasks () {
    $.ajax({
        type: &lt;SPAN style="color: #6a8759;"&gt;'GET'&lt;/SPAN&gt;,
        url: &lt;SPAN style="color: #6a8759;"&gt;'alltasks'&lt;/SPAN&gt;,
        dataType: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;,
        error: &lt;SPAN style="color: #cc7832;"&gt;function&lt;/SPAN&gt;(req, err){ console.log(&lt;SPAN style="color: #6a8759;"&gt;'my message' &lt;/SPAN&gt;+ err); },
        success: &lt;SPAN style="color: #cc7832;"&gt;function&lt;/SPAN&gt;(data) { console.log(data); }
    });
};
ajaxGetTasks();&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;The serialized JSON looks like:

[{"id":1,"title":"Test Task","location":{"type":"Point","coordinates":[174.896,-36.829]}}]

How would I get this to a format so it can be added to a Feature Layer? Looks like I might be able 
to call the fromJSON() method, but I am unclear on the details.

Thanks

Al

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:17:19 GMT</pubDate>
    <dc:creator>AlGrant</dc:creator>
    <dc:date>2021-12-11T14:17:19Z</dc:date>
    <item>
      <title>Create Feature Layer from JSON</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-layer-from-json/m-p/297762#M27366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have create a java based tomcat web server with a REST endpoint to serve up JSON with point geometry. The output JSON which is a list of features in a class called Task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AJAX call looks like:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;function &lt;/SPAN&gt;ajaxGetTasks () {
    $.ajax({
        type: &lt;SPAN style="color: #6a8759;"&gt;'GET'&lt;/SPAN&gt;,
        url: &lt;SPAN style="color: #6a8759;"&gt;'alltasks'&lt;/SPAN&gt;,
        dataType: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;,
        error: &lt;SPAN style="color: #cc7832;"&gt;function&lt;/SPAN&gt;(req, err){ console.log(&lt;SPAN style="color: #6a8759;"&gt;'my message' &lt;/SPAN&gt;+ err); },
        success: &lt;SPAN style="color: #cc7832;"&gt;function&lt;/SPAN&gt;(data) { console.log(data); }
    });
};
ajaxGetTasks();&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;The serialized JSON looks like:

[{"id":1,"title":"Test Task","location":{"type":"Point","coordinates":[174.896,-36.829]}}]

How would I get this to a format so it can be added to a Feature Layer? Looks like I might be able 
to call the fromJSON() method, but I am unclear on the details.

Thanks

Al

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/create-feature-layer-from-json/m-p/297762#M27366</guid>
      <dc:creator>AlGrant</dc:creator>
      <dc:date>2021-12-11T14:17:19Z</dc:date>
    </item>
  </channel>
</rss>

