Share via


RouteSpecification.ResultMask Property

RouteSpecification.ResultMask Property

Indicates, as a RouteResultMask enumeration, whether a returned route should include driving directions, a calculated route representation, or both.


Public ResultMask As RouteResultMask


[C#]

public RouteResultMask ResultMask;

Remarks

  • The default is both driving directions and a calculated route representation.

  • A calculated route representation is used to render a highlighted route on a map.

Example

[Visual Basic]

'Route between two locations, return directions
'and the CalculatedRouteRepresentation object
Dim startLocation As New Location()
Dim endLocation As New Location()
startLocation.LatLong = New LatLong()
endLocation.LatLong = New LatLong()
startLocation.LatLong.Latitude = 40
startLocation.LatLong.Longitude = -120
endLocation.LatLong.Latitude = 41
endLocation.LatLong.Longitude = -121

Dim routeSegmentsSpec(1) As SegmentSpecification
routeSegmentsSpec(0) = New SegmentSpecification()
routeSegmentsSpec(0).Waypoint = New Waypoint()
routeSegmentsSpec(0).Waypoint.Name = "Start"
routeSegmentsSpec(0).Waypoint.Location = startLocation
routeSegmentsSpec(1) = New SegmentSpecification()
routeSegmentsSpec(1).Waypoint = New Waypoint()
routeSegmentsSpec(1).Waypoint.Name = "End"
routeSegmentsSpec(1).Waypoint.Location = endLocation

Dim routeSpec As New RouteSpecification()
routeSpec.DataSourceName = "MapPoint.NA"
routeSpec.ResultMask = RouteResultMask.Itinerary Or RouteResultMask.CalculatedRouteRepresentation
routeSpec.Segments = routeSegmentsSpec

Dim myRoute As Route
myRoute = routeService.CalculateRoute(routeSpec)



[C#]

//Route between two locations, return the
//directions and the CalculatedRouteRepresentation object
Location startLocation = new Location();
Location endLocation = new Location();
startLocation.LatLong = new LatLong();
endLocation.LatLong = new LatLong();
startLocation.LatLong.Latitude = 40;
startLocation.LatLong.Longitude = -120;
endLocation.LatLong.Latitude = 41;
endLocation.LatLong.Longitude = -121;

SegmentSpecification[] routeSegmentsSpec = new SegmentSpecification[2];
routeSegmentsSpec[0] = new SegmentSpecification();
routeSegmentsSpec[0].Waypoint = new Waypoint();
routeSegmentsSpec[0].Waypoint.Name = "Start";
routeSegmentsSpec[0].Waypoint.Location = startLocation;
routeSegmentsSpec[1] = new SegmentSpecification();
routeSegmentsSpec[1].Waypoint = new Waypoint();
routeSegmentsSpec[1].Waypoint.Name = "End";
routeSegmentsSpec[1].Waypoint.Location = endLocation;

RouteSpecification routeSpec = new RouteSpecification();
routeSpec.DataSourceName = "MapPoint.NA";
routeSpec.ResultMask = RouteResultMask.Itinerary | RouteResultMask.CalculatedRouteRepresentation;
routeSpec.Segments = routeSegmentsSpec;

Route myRoute;
myRoute = routeService.CalculateRoute(routeSpec);


See Also

  RouteSpecification Class   |   RouteResultMask Enumeration