Share via


ViewByBoundingRectangle.BoundingRectangle Property

ViewByBoundingRectangle.BoundingRectangle Property

The latitude and longitude coordinates (LatLongRectangle object) that represent the southwest and northeast corners of a minimum bounding rectangle.


Public BoundingRectangle As LatLongRectangle



[C#]

public LatLongRectangle BoundingRectangle;

Remarks

  • Although the BoundingRectangle property is called a rectangle, the shape defined by the LatLongRectangle class is not a true rectangle on the sphere of the Earth. Rather, the shape is rounded and three dimensional, and MapPoint Web Service interprets it as such.

  • For information about map views, including the relationship between map views and map image size, see Working with Map Views.

Example

[Visual Basic]

'Get a map using a bounding rectangle
Dim myViews(0) As ViewByBoundingRectangle
myViews(0) = New ViewByBoundingRectangle()
myViews(0).BoundingRectangle = New LatLongRectangle()
myViews(0).BoundingRectangle.Northeast = New LatLong()
myViews(0).BoundingRectangle.Southwest = New LatLong()
myViews(0).BoundingRectangle.Northeast.Latitude = 41
myViews(0).BoundingRectangle.Northeast.Longitude = -121
myViews(0).BoundingRectangle.Southwest.Latitude = 40
myViews(0).BoundingRectangle.Southwest.Longitude = -122

Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews

Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)



[C#]

//Get a map using a bounding rectangle
ViewByBoundingRectangle[] myViews = new ViewByBoundingRectangle[1];
myViews[0] = new ViewByBoundingRectangle();
myViews[0].BoundingRectangle = new LatLongRectangle();
myViews[0].BoundingRectangle.Northeast = new LatLong();
myViews[0].BoundingRectangle.Southwest = new LatLong();
myViews[0].BoundingRectangle.Northeast.Latitude = 41;
myViews[0].BoundingRectangle.Northeast.Longitude = -121;
myViews[0].BoundingRectangle.Southwest.Latitude = 40;
myViews[0].BoundingRectangle.Southwest.Longitude = -122;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;

MapImage[] mapImages;
mapImages = renderService.GetMap(mapSpec);


See Also

  ViewByBoundingRectangle Class   |   LatLongRectangle Class   |   Working with Map Views