Description
Class added v2.0.
Input parameters for the distance method on the GeometryService. Geometry1 and geometry2 are required.
Samples
Search for
samples that use this class.
Class hierarchy
esri.tasks.DistanceParameters
Constructor
Properties
| distanceUnit |
esri.tasks.GeometryService Constant
|
Specifies the units for measuring distance between geometry1 and geometry2. If the unit is not specified the units are derived from the spatial reference. |
| geodesic |
Boolean
|
Default value is false. When true the geodesic distance between geometry1 and geometry2 is measured. |
| geometry1 |
Geometry
|
The geometry from which the distance is to measured. The geometry can be one of the following geometry types: esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon or esriGeometryMultipoint. |
| geometry2 |
Geometry
|
The geometry to which the distance is measured. The geometry can be one of the following geomtry types: esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon or esriGeometryMultipoint. |
Constructor Detail
esri.tasks.DistanceParameters()
Creates a new DistanceParameters object. The constructor takes no parameters.
Code snippets:
var distParams = new esri.tasks.DistanceParameters();
Properties Detail
<esri.tasks.GeometryService Constant> distanceUnit
Specifies the units for measuring distance between geometry1 and geometry2. If the unit is not specified the units are derived from the spatial reference.
Code snippets:
distParams.distanceUnit = esri.tasks.GeometryService.UNIT_STATUTE_MILE;
Default value is false. When true the geodesic distance between geometry1 and geometry2 is measured.
Code snippets:
distParams.geodesic = true;
The geometry from which the distance is to measured. The geometry can be one of the following geometry types: esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon or esriGeometryMultipoint.
Code snippets:
distParams.geometry1 = inputPoints[inputPoints.length -2];
The geometry to which the distance is measured. The geometry can be one of the following geomtry types: esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon or esriGeometryMultipoint.
Code snippets:
distParams.geometry2 = inputPoints[inputPoints.length -1];