Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Object: esri/graphicsUtils

require(["esri/graphicsUtils"], function(graphicsUtils) { /* code goes here */ });

Description

(Added at v3.8)
Utility methods for working with graphics.

When coding legacy (non-AMD) style, there is no need to require the module. All methods and properties are available in the namespace. For example, esri.getGeometries().

Samples

Search for samples that use this class.

Methods

NameReturn typeSummary
getGeometries(graphics)Geometry[]Converts an array of graphics to an array of geometries.
graphicsExtent(graphics)ExtentUtility function that returns the extent of an array of graphics.
Method Details

getGeometries(graphics)

Converts an array of graphics to an array of geometries. This is primarily used by GeometryService.
Return type: Geometry[]
Parameters:
<Graphic[]> graphics Required Array of graphics to convert to geometries
Sample:
require([
  "esri/graphicsUtils", ... 
], function(graphicsUtils, ... ) {
  geometries[0] = graphicsUtils.getGeometries(baseGraphics);
  ...
});

graphicsExtent(graphics)

Utility function that returns the extent of an array of graphics.
Return type: Extent
Parameters:
<Graphic[]> graphics Required The input graphics array.
Sample:
require([
  "esri/graphicsUtils", ... 
], function(graphicsUtils, ... ) {
  var myFeatureExtent = graphicsUtils.graphicsExtent(myFeatureSet.features);
  ...
});