Segment.View Property
Segment.View Property
The map view representations (MapViewRepresentations object) for the route segment. Contains the view by bounding rectangle coordinates, and the view by latitude and longitude coordinates of the center point, height, and width.
Public View As MapViewRepresentations
[C#]
public MapViewRepresentations View;
Remarks
- The View property is returned only when the SegmentOptions.CalculateSegmentMapView property is set to True.
Example
[Visual Basic]
'Calculate a route and use the segment view to
'get a map for each segment of the route
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
Dim myRoute As Route
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest)
Dim mySegmentViews(1) As ViewByHeightWidth
mySegmentViews(0) = myRoute.Itinerary.Segments(0).View.ByHeightWidth
mySegmentViews(1) = myRoute.Itinerary.Segments(1).View.ByHeightWidth
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Route = myRoute
mapSpec.Views = mySegmentViews
Dim myMaps() As MapImage
myMaps = renderService.GetMap(mapSpec)
[C#]
//Calculate a route and use the segment view to
//get a map for each segment of the route
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;
Route myRoute;
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest);
ViewByHeightWidth[] mySegmentViews = new ViewByHeightWidth[2];
mySegmentViews[0] = myRoute.Itinerary.Segments[0].View.ByHeightWidth;
mySegmentViews[1] = myRoute.Itinerary.Segments[1].View.ByHeightWidth;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Route = myRoute;
mapSpec.Views = mySegmentViews;
MapImage[] myMaps = renderService.GetMap(mapSpec);
See Also
Segment Class | MapViewRepresentations Class | SegmentOptions.CalculateSegmentMapView Property