Description
Class added v2.0.
Sets the lengthunits other parameters for Lengths operation.
Samples
Search for
samples that use this class.
Class hierarchy
esri.tasks.LengthsParameters
Constructor
Properties
| geodesic |
Boolean
|
If polylines are in geographic coordinate system, then geodesic needs to be set to true in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. The output if lengthUnit if not specified is returned in meters. |
| lengthUnit |
esri.tasks.GeometryService constant
|
The length unit in which perimeters of polygons will be calculated. It can be any esriUnits constant. If unit is not specified, the units are derived from sr. For a list of valid units, see esriSRUnitType constants and esriSRUnit2Type Constants. |
| polylines |
Geometry[]
|
The array of polylines whose lengths are to be computed. The spatial reference of the polylines is specified by sr. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. |
Constructor Detail
esri.tasks.LengthsParameters()
Creates a new LengthsParameter object.
Code snippets:
var lengthParams = new esri.tasks.LengthsParameters();
Properties Detail
If polylines are in geographic coordinate system, then geodesic needs to be set to true in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. The output if lengthUnit if not specified is returned in meters.
Code snippets:
lengthParams.geodesic = true;
<esri.tasks.GeometryService constant> lengthUnit
The length unit in which perimeters of polygons will be calculated. It can be any esriUnits constant. If unit is not specified, the units are derived from sr. For a list of valid units, see esriSRUnitType constants and esriSRUnit2Type Constants.
Code snippets:
lengthParams.lengthUnit = esri.tasks.GeometryService.UNIT_METER;
The array of polylines whose lengths are to be computed. The spatial reference of the polylines is specified by sr. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API.
Code snippets:
lengthParams.polylines = [geometry];