(Added at v2.0)
Input parameters for the distance method on the GeometryService. Geometry1 and geometry2 are required.
Search for samples
that use this class.
Creates a new DistanceParameters object. The constructor takes no parameters.
var distParams = new esri.tasks.DistanceParameters();
Specifies the units for measuring distance between geometry1 and geometry2. See the constants table of GeometryService
for a list of valid values. If the unit is not specified the units are derived from the spatial reference.
distParams.distanceUnit = esri.tasks.GeometryService.UNIT_STATUTE_MILE;
When true, the geodesic distance between geometry1 and geometry2 is measured.
true | false
distParams.geodesic = true;
The geometry from which the distance is to be measured. The geometry can be one of the following geometry types:
esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryMultipoint.
distParams.geometry1 = inputPoints[inputPoints.length -2];
The geometry to which the distance is measured. The geometry can be one of the following geometry types: esriGeometryPoint, esriGeometryPolyline, esriGeometryPolygon or esriGeometryMultipoint.
distParams.geometry2 = inputPoints[inputPoints.length -1];