DistanceUnit Enumeration
DistanceUnit Enumeration
The possible units of measurement for measuring distances on the map.
Public Enum DistanceUnit Inherits System.Enum
[C#]
public enum DistanceUnit : System.Enum
Members
The following table lists the values for the DistanceUnit enumeration.
Name | Description |
---|---|
Kilometers | Kilometers. |
Miles | Miles. |
Example
[Visual Basic]
'Calculate a route and get the distance units
'returned in miles
Dim latLongs(1) As LatLong
latLongs(0) = New LatLong()
latLongs(0).Latitude = 40
latLongs(0).Longitude = -120
latLongs(1) = New LatLong()
latLongs(1).Latitude = 41
latLongs(1).Longitude = -121
routeService.UserInfoRouteHeaderValue = New UserInfoRouteHeader()
routeService.UserInfoRouteHeaderValue.DefaultDistanceUnit = DistanceUnit.Mile
Dim myRoute As Route
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest)
[C#]
//Calculate a route and get the distance
//units returned in miles
LatLong[] latLongs = new LatLong[2];
latLongs[0] = new LatLong();
latLongs[0].Latitude = 40;
latLongs[0].Longitude = -120;
latLongs[1] = new LatLong();
latLongs[1].Latitude = 41;
latLongs[1].Longitude = -121;
routeService.UserInfoRouteHeaderValue = new UserInfoRouteHeader();
routeService.UserInfoRouteHeaderValue.DefaultDistanceUnit = DistanceUnit.Mile;
Route myRoute;
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest);
See Also
UserInfoHeader.DefaultDistanceUnit Property