differenceOperator

AMD: require(["esri/geometry/operators/differenceOperator"], (differenceOperator) => { /* code goes here */ });
ESM: import * as differenceOperator from "@arcgis/core/geometry/operators/differenceOperator.js";
Object: esri/geometry/operators/differenceOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta

Performs a topological difference operation on 2D geometries.

Method Overview

Name Return Type Summary Object

Performs the topological difference operation on the two geometries.

differenceOperator

Performs the Topological difference operation on the geometry set.

differenceOperator

Method Details

execute

Method
execute(geometry, subtractor){Geometry |null}

Performs the topological difference operation on the two geometries.

Parameters
geometry Geometry

The geometry instance on the left hand side of the subtraction.

subtractor Geometry

The geometry on the right hand side being subtracted.

Returns
Type Description
Geometry | null Returns the result of the subtraction from the geometry, or null. The result has the dimensions of the geometry.
Example
// Creates a new geometry based on the difference of two polygons
const difference = differenceOperator.execute(polygon1, polygon2);

executeMany

Method
executeMany(geometries, subtractor){Array<(Geometry|null)>}

Performs the Topological difference operation on the geometry set.

Parameters
geometries Geometry

The set of geometry instance to be subtracted by the subtractor.

subtractor Geometry

The geometry on the right hand side being subtracted.

Returns
Type Description
Array<(Geometry|null)> Returns an array whose elements are the result of subtracting each input geometry from geometries, or null. The result has the dimensions of the geometries.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.