LengthDimension

AMD: require(["esri/analysis/LengthDimension"], (LengthDimension) => { /* code goes here */ });
ESM: import LengthDimension from "@arcgis/core/analysis/LengthDimension";
Class: esri/analysis/LengthDimension
Inheritance: LengthDimension Accessor
Since: ArcGIS API for JavaScript 4.25

Length dimension enables the measurement of linear distances between the specified start and ending points. Depending on the measure type, either direct, horizontal, or vertical distance between these points is measured.

length-dimension-measure-types
// create the dimension object
const lengthDimension = new LengthDimension({
   measureType: "vertical",
   startPoint: new Point({
      spatialReference: {
        wkid: 32610
      },
      x: 265,
      y: 24,
      z: 26
   }),
   endPoint: new Point({
      spatialReference: {
        wkid: 32610
      },
      x: 265,
      y: 24,
      z: 38
   }),
   orientation: 90,
   offset: 2
});
// create analysis and add the dimension object to it.
const dimensionAnalysis = new DimensionAnalysis({
   dimensions: [lengthDimension]
});

Known Limitations

  • Dimensioning is only supported in a 3D SceneView.
  • Only euclidean distances are measured.
  • Vertical and horizontal dimensions can be used to measure distances of up to 100 kilometers. To measure longer distances use the "direct" measureType instead.
See also

Constructors

new LengthDimension(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
String

The name of the class.

more details
Accessor
Point

Ending point for the dimension.

more details
LengthDimension
String

The type of length that should be measured between the startPoint and endPoint.

more details
LengthDimension
Number

Styling option that controls the shortest distance from the startPoint or endPoint to the dimension line in meters.

more details
LengthDimension
Number

The orientation determines the relative direction the dimension line is extended to.

more details
LengthDimension
Point

Starting point for the dimension.

more details
LengthDimension

Property Details

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

endPoint Pointautocast

Ending point for the dimension.

measureType String

The type of length that should be measured between the startPoint and endPoint. The measureType allows the user to measure either the horizontal distance (delta in xy space), vertical distance (elevation difference), or direct distance between the start and end points. If either vertical or horizontal mode is used, the orientation is not applied and the offset direction is relative to the input points (on a plane derived from them).

length-dimension-measure-types

Possible Values:"direct"|"horizontal"|"vertical"

Default Value:"direct"
offset Number

Styling option that controls the shortest distance from the startPoint or endPoint to the dimension line in meters.

length-dimension-offset
Default Value:0
orientation Number

The orientation determines the relative direction the dimension line is extended to. It applies only to direct dimensions and when an offset is specified.

An orientation of 0 extends the offset upwards, whereas an orientation of 90 extends the offset sideways, to the right side of the dimension when viewing from its start point. When the start and end points are vertically aligned, increasing the orientation rotates the dimension clockwise relative to compass north.

length-dimension-orientation
Default Value:0
startPoint Pointautocast

Starting point for the dimension.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

more details
Accessor
this

Creates a deep clone of this object.

more details
LengthDimension
Boolean

Returns true if a named group of handles exist.

more details
Accessor

Removes a group of handles owned by the object.

more details
Accessor

Method Details

addHandles(handleOrHandles, groupKey)inherited

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

// Handle gets removed when the object is destroyed.
this.addHandles(handle);
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

clone(){this}

Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.

Returns
Type Description
this A deep clone of the class instance that invoked this method.
hasHandles(groupKey){Boolean}inherited

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}
removeHandles(groupKey)inherited

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

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