<?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 Re: Using Geometry.fromJSON() gives unexpected results in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583047#M54451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric, I would try using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#fromJSON"&gt;Point.fromJSON()&lt;/A&gt; instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 May 2020 23:56:44 GMT</pubDate>
    <dc:creator>AnneFitz</dc:creator>
    <dc:date>2020-05-07T23:56:44Z</dc:date>
    <item>
      <title>Using Geometry.fromJSON() gives unexpected results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583046#M54450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#fromJSON" rel="nofollow noopener noreferrer" target="_blank"&gt;Geometry.fromJSON()&lt;/A&gt; in the ArcGIS JSAPI 4.x to return a Point or an Extent geometry and I am getting some unexpected results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have tried.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;const point = Geometry.fromJSON({x: 10, y: 10, spatialReference: {wkid: 4326}})
const point = Geometry.fromJSON({type: "point", x: 10, y: 10, spatialReference: {wkid: 4326}})
const point = Geometry.fromJSON(JSON.stringify({x: 10, y: 10, spatialReference: {wkid: 4326}}))
const point = Geometry.fromJSON({"x": 10, "y": 10, "spatialReference": {"wkid": 4326}})
const point = Geometry.fromJSON('{"x": 10, "y": 10, "spatialReference": {"wkid": 4326}}')
...
console.log(JSON.stringify(point.toJSON()))&lt;/PRE&gt;&lt;P&gt;Here is the result in the console.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{"spatialReference":{"wkid":4326}}&lt;/PRE&gt;&lt;P&gt;Should I be able to get a Point geometry with the JSON I am using with Geometry.fromJSON()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal would be to do the following...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mapView.goTo(Geometry.fromJSON({....});&lt;/PRE&gt;&lt;P&gt;...using valid JSON for a Point or an Extent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583046#M54450</guid>
      <dc:creator>EricPaitz</dc:creator>
      <dc:date>2021-12-12T16:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Geometry.fromJSON() gives unexpected results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583047#M54451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric, I would try using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#fromJSON"&gt;Point.fromJSON()&lt;/A&gt; instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2020 23:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583047#M54451</guid>
      <dc:creator>AnneFitz</dc:creator>
      <dc:date>2020-05-07T23:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Geometry.fromJSON() gives unexpected results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583048#M54452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anne,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the reply. I did notice that worked, and I forgot to add that detail to my post. The JSON will be describing a point or an extent so I was hoping that Geomery.fromJSON() would be able to create a Point from point JSON and an Extent from extent JSON. Am I using Geometry.fromJSON() incorrectly?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2020 14:17:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-geometry-fromjson-gives-unexpected-results/m-p/583048#M54452</guid>
      <dc:creator>EricPaitz</dc:creator>
      <dc:date>2020-05-11T14:17:44Z</dc:date>
    </item>
  </channel>
</rss>

