Finds the lengths of an array of VEShapes or paths in a JSON-formatted object containing geometries.
Namespace:
ESRI.ArcGIS.VE(in ArcGISVE.exe)
Syntax
| JScript |
|---|
function Lengths( shapesOrGeometries : Object, callback : Function, distanceUnits : DistanceUnits, WKID : String ) |
Parameters
- shapesOrGeometries
- Type: Object
Array of VEShapes or JSON-formatted object containing geometries to be measured.
- callback
- Type: Function
Function that will handle response. The callback function must take one argument, which will be a MeasureSet instance.
- distanceUnits
- Type: DistanceUnits
Type of distance units the distance result should be. Optional; defaults to meters for VEShapes. Ignored for measurement of JSON geometries.
- WKID
- Type: String
Well known ID of the spatial reference. Required for measurement of JSON geometries for VEShapes. Ignored for measurement of VEShapes.
Remarks
Use this method to calculate the lengths of one or more polylines. The polylines can be either a set of VEShapes or a JSON object that contains geometries. If using VEShapes, you may specify the units for the returned measurement in DistanceUnits, or omit this parameter to accept the default of meters.
If using JSON geometries, you must specify the spatial reference identifier (WKID), since the JSON object can be in any coordinate system. The WKID can be specified with the numeric identifier, or you can use the SRUnitTypes enumeration. The distanceUnits parameter is ignored for JSON geometries (so may be set to null), because the returned measurement is in the units of the spatial reference, not necessarily meters.
For examples of using this function with both VEShapes and JSON geometries, see the "Work with Geometry" section of the Interactive SDK.
