extendOperator

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

Extend 2D polylines with a polyline.

By default, this considers both ends of parts. The old ends remain and new points are added at the extended ends. The new points have attributes that are extrapolated from adjacent existing segments.

Method Overview

Name Return Type Summary Object

Performs the extend operation on a polyline using a polyline as the extender.

extendOperator

Method Details

execute

Method
execute(polyline1, polyline2, options){Polyline |null}

Performs the extend operation on a polyline using a polyline as the extender.

Parameters
Specification
polyline1 Polyline

The polyline to be extended.

polyline2 Polyline

The polyline to extend to.

options Object
optional

Additional options.

Specification
relocateEnds Boolean
optional

If an extension is performed at an end, relocate the end point to the new position instead of leaving the old point and adding a new point at the new position.

keepEndAttributes Boolean
optional

If an extension is performed at an end, do not extrapolate the end-segment's attributes for the new point. Instead, make its attributes the same as the current end. Incompatible with noEndAttributes.

noEndAttributes Boolean
optional

If an extension is performed at an end, do not extrapolate the end-segment's attributes for the new point. Instead, make its attributes empty. Incompatible with keepEndAttributes.

noExtendAtFrom Boolean
optional

Do not extend the 'from' end of any part.

noExtendAtTo Boolean
optional

Do not extend the 'to' end of any part.

Returns
Type Description
Polyline | null Returns the extended polyline or null. The output polyline will have the first and last segment of each path extended to polyline2 if the segments can be interpolated to intersect it. In the case that the segments can be extended to multiple segments of the extender, polyline2, the shortest extension is chosen. Only end points for paths that are not shared by the end points of other paths will be extended. If the polyline cannot be extended, then null is returned.

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