jsonUtils

require(["esri/geometry/support/jsonUtils"], function(geometryJsonUtils) { /* code goes here */ });
Object: esri/geometry/support/jsonUtils
Since: ArcGIS API for JavaScript 4.0

Provides utility methods for working with ArcGIS JSON geometry objects.

Method Overview

NameReturn TypeSummaryObject
Geometry

Creates a new instance of an appropriate Geometry class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsjsonUtils
String

Returns the type for a given geometry in the JSON format used by the ArcGIS platform.

more details
more detailsjsonUtils

Method Details

fromJSON(json){Geometry}

Creates a new instance of an appropriate Geometry class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. 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.

Parameter:
json Object

A 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.

Returns:
TypeDescription
GeometryReturns a new instance of an appropriate Geometry class.

getJsonType(geometry){String}

Returns the type for a given geometry in the JSON format used by the ArcGIS platform. This only applies to geometries that can be processed by the server.

Parameter:
geometry Geometry

The input geometry object.

Returns:
TypeDescription
StringReturns the type as represented on the server.

API Reference search results

NameTypeModule

There were no match results from your search criteria.