Share via


UserInfoHeader.DefaultDistanceUnit Property

UserInfoHeader.DefaultDistanceUnit Property

Defines the unit of measure (miles or kilometers) as a DistanceUnit enumeration to use for input or output parameters.


Public DefaultDistanceUnit As DistanceUnit


[C#]

public DistanceUnit DefaultDistanceUnit;

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 Class   |   DistanceUnit Enumeration   |   CommonServiceSoap.GetGreatCircleDistances Method