import { graphicBufferExecuteMany, executeMany, graphicBufferSupportsCurves, supportsCurves } from "@arcgis/core/geometry/operators/graphicBufferOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

Creates planar buffers around 2D geometries using graphical joins and caps.

Graphic buffer operator

Type definitions

GraphicBufferOptions

Type definition
Since
ArcGIS Maps SDK for JavaScript 5.2

maxDeviation

Property
Type
number | undefined

The max deviation of the result buffer from the true buffer in the spatial reference units of geometries. When the value is NaN, internal logic is used to select the deviation based on the buffer distance. Unless the unit option is set, the default is the spatial reference unit of geometries.

Default value
NaN

maxVerticesInFullCircle

Property
Type
number | undefined

The maximum number of vertices in the polygon produced from a buffered point.

Default value
96

miterLimit

Property
Type
number | undefined

Defines when miter joins are replaced with bevel joins.

Default value
10

union

Property
Type
boolean | undefined

Indicates if the buffer geometries should be unioned. When set to true, the output will be a single geometry.

Default value
false

unit

Property
Type
LengthUnit | undefined

The length unit of the buffer distances and max deviation. The default is the spatial reference unit of the input geometries. An error will be thrown if this is set for Geographic Coordinate Systems.

Options

deprecated Type definition

Functions

graphicBufferExecuteMany

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Creates a buffer around the input geometries, using graphical joins and caps.

Both maxDeviation and maxVerticesInFullCircle control the quality of round joins that are in the buffers. The precision of each buffer is defined by maxDeviation unless the number of required vertices is too large.

Signature
graphicBufferExecuteMany (geometries: GeometryUnion[], distances: number[], joins: "round" | "miter" | "bevel", caps: "round" | "butt" | "square", options?: GraphicBufferOptions): Polygon[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries to be buffered. All the geometries must have the same spatial reference.

distances
number[]

The buffer distances for the geometries. If the size of this array is less than the number of geometries in the input geometries, the last distance value is used for the rest of geometries. Unless the unit option is set, the default is the spatial reference unit of geometries.

joins
"round" | "miter" | "bevel"

Defines the buffer's shape where geometries are joined.

  • Miter joins are replaced with bevel when the ratio of the miter thickness to the buffer distance is greater than miter limit. The miter thickness is the distance from the vertex to the mitered corner of the buffer that this vertex generates.
caps
"round" | "butt" | "square"

Defines the buffer's shape at the end points of the geometries.

  • Points with square caps will be drawn as squares.
  • Open polyline paths with square caps degenerate to a point and will be drawn as squares (degenerate with zero tolerance).
  • Open polyline paths with round caps degenerate to a point and will be drawn as circles (degenerate with zero tolerance).
options

Additional options.

Returns
Polygon[]

Returns the buffered geometries.

Example
// Buffer two polylines with different distances and buffer styles.
const buffers = graphicBufferExecuteMany(
[polyline1, polyline2],
[1000, 1500],
"square",
"round",
{ miterLimit: 10 },
);

executeMany

deprecated Function

Creates a buffer around the input geometries, using graphical joins and caps.

Both maxDeviation and maxVerticesInFullCircle control the quality of round joins that are in the buffers. The precision of each buffer is defined by maxDeviation unless the number of required vertices is too large.

Signature
executeMany (geometries: GeometryUnion[], distances: number[], joins: "round" | "miter" | "bevel", caps: "round" | "butt" | "square", options?: GraphicBufferOptions): Polygon[]

Parameters

ParameterTypeDescriptionRequired
geometries

The input geometries to be buffered. All the geometries must have the same spatial reference.

distances
number[]

The buffer distances for the geometries. If the size of this array is less than the number of geometries in the input geometries, the last distance value is used for the rest of geometries. Unless the unit option is set, the default is the spatial reference unit of geometries.

joins
"round" | "miter" | "bevel"

Defines the buffer's shape where geometries are joined.

  • Miter joins are replaced with bevel when the ratio of the miter thickness to the buffer distance is greater than miter limit. The miter thickness is the distance from the vertex to the mitered corner of the buffer that this vertex generates.
caps
"round" | "butt" | "square"

Defines the buffer's shape at the end points of the geometries.

  • Points with square caps will be drawn as squares.
  • Open polyline paths with square caps degenerate to a point and will be drawn as squares (degenerate with zero tolerance).
  • Open polyline paths with round caps degenerate to a point and will be drawn as circles (degenerate with zero tolerance).
options

Additional options.

Returns
Polygon[]

Returns the buffered geometries.

Example
// Buffer two polylines with different distances and buffer styles.
const buffers = graphicBufferExecuteMany(
[polyline1, polyline2],
[1000, 1500],
"square",
"round",
{ miterLimit: 10 },
);

Variables

graphicBufferSupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

Indicates if the operator supports input geometries that contain curves. The value will always be true. This will produce densified output geometries.

Type
boolean

supportsCurves

deprecated Variable

Indicates if the operator supports input geometries that contain curves. The value will always be true. This will produce densified output geometries.

Type
ReturnType