require(["esri/geometry/support/jsonUtils"], (geometryJsonUtils) => { /* code goes here */ });
import * as geometryJsonUtils from "@arcgis/core/geometry/support/jsonUtils.js";
esri/geometry/support/jsonUtils
Provides utility methods for working with ArcGIS JSON geometry objects.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Creates a new instance of an appropriate Geometry class and initializes it with values from a JSON object generated from an ArcGIS product. | jsonUtils | ||
Returns the type for a given geometry in the JSON format used by ArcGIS. | jsonUtils |
Method Details
-
fromJSON
fromJSON(json){Geometry}
-
Creates a new instance of an appropriate Geometry class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameterjson ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
ReturnsType Description Geometry Returns a new instance of an appropriate Geometry class.