Calculates the distance between two points in a map (data frame).
ComputeDistance(string MapName, Point FromPoint, Point ToPoint, esriUnits Units)
Parameter |
Description |
MapName |
The name of the data frame in the map service. |
FromPoint |
The starting point in the line. The spatial reference is assumed to be the same as the data frame. |
ToPoint |
The ending point in the line. The spatial reference is assumed to be the same as the data frame. |
Units |
The unit of measure in which the distance between two points will be returned. |
Return Value
A double value representing the distance between the FromPoint and ToPoint in the Units defined.
Remarks
The MapName parameter references a data frame name in the map service associated with the map service proxy. The data frame must have a valid spatial reference. The coordinates defined for the both points in the line assume the data frame's spatial reference.
Examples