ESM: import LengthDimension from "@arcgis/core/analysis/LengthDimension.js";
CDN: const LengthDimension = await $arcgis.import("@arcgis/core/analysis/LengthDimension.js");
Class: @arcgis/core/analysis/LengthDimension
Since: ArcGIS Maps SDK for JavaScript 4.25
LengthDimension enables the measurement of linear distances between the specified start and end points. Depending on the measure type, either the direct, horizontal, or vertical distance between these points is measured.
Length dimensions can be displayed by adding them to a DimensionAnalysis.
// 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]
});
// add the analysis to the view
view.analyses.push(dimensionAnalysis);
Known Limitations
measureType
instead. new LengthDimension(properties)
Parameter
optionalSee the properties for a list of all the properties that may be passed into the constructor.
Show inherited properties Hide inherited properties
Property DetailsInherited
Property declaredClass Stringreadonly
The name of the class. The declared class name is formatted as esri.folder.className
.
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).
Possible Values:"direct" |"horizontal" |"vertical"
Styling option that controls the shortest distance from the startPoint or endPoint to the dimension line in meters.
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.
Starting point for the dimension.
valid Booleanreadonly
Since: ArcGIS Maps SDK for JavaScript 4.33 LengthDimension since 4.25, valid added at 4.33.
Indicates whether the dimension is ready to be computed and interacted with in the view. It requires both the startPoint and endPoint to be set.
Show inherited methods Hide inherited methods
Method DetailsInherited
Method addHandles(handleOrHandles, groupKey)
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 }
);
this.addHandles(handle);
// Destroy the object
this.destroy();
Parameters
Handles marked for removal once the object is destroyed.
groupKey *
optionalKey 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.Inherited
Method hasHandles(groupKey){Boolean}
Returns true if a named group of handles exist.
Parameter
groupKey *
optionalA group key.
Returns
Type Description Boolean Returnstrue
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");
}
Inherited
Method removeHandles(groupKey)
Removes a group of handles owned by the object.
Parameter
groupKey *
optionalA 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");
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4