AMD:
require(["esri/geometry/operators/isNearOperator"], (isNearOperator) => { /* code goes here */ });
ESM:
import * as isNearOperator from "@arcgis/core/geometry/operators/isNearOperator.js";
Object:
esri/geometry/operators/isNearOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta
Performs a 2D relational operation that checks if two geometries are near each other.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Returns true if the geometries are not further than the given 2D distance from each other. | isNearOperator |
Method Details
-
execute
execute(geometry1, geometry2, distance, options){Boolean}
-
Returns true if the geometries are not further than the given 2D distance from each other.
Parametersgeometry1 GeometryThe first geometry.
geometry2 GeometryThe second geometry.
distance GeometryThe distance (must be positive). Unless the
unit
option is set, the default is the geometry's spatial reference unit.options ObjectoptionalAdditional options.
Specificationunit LengthUnitoptionalThe length unit of the distance. An error will be thrown if this is set for Geographic Coordinate Systems.
ReturnsType Description Boolean Returns true
if the minimum distance between the two geometries is equal or less thandistance
.Example// Check if two geometries are near each other const isNear = isNearOperator.execute(point, polyline, 100);