Share via


MapImage.View Property

MapImage.View Property

Contains representations of the view of the map (MapViewRepresentations object), which includes a view by the center point and map scale, a view by bounding rectangle, and a view by the center point and height and width of the map.


Public View As MapViewRepresentations



[C#]

public MapViewRepresentations View;

Remarks

Example

[Visual Basic]

'Take an existing view, pan east, and set the current
'view to the returned view
Dim myViews(0) As ViewByScale
myViews(0) = New ViewByScale()
myViews(0).CenterPoint = New LatLong()
myViews(0).CenterPoint.Latitude = 40
myViews(0).CenterPoint.Longitude = -120
myViews(0).MapScale = 5000

Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
mapSpec.Options = New MapOptions()
mapSpec.Options.PanHorizontal = 0.5

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

'Set the map view to the returned view
myViews(0) = mapImages(0).View.ByScale



[C#]

//Take an existing view, pan east, and set the current
//view to the returned view
ViewByScale[] myViews = new ViewByScale[1];
myViews[0] = new ViewByScale();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].MapScale = 5000;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
mapSpec.Options = new MapOptions();
mapSpec.Options.PanHorizontal = 0.5;

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

//Set the map view to the returned view
myViews[0] = mapImages[0].View.ByScale;


See Also

  MapImage Class   |   MapViewRepresentations Class   |   RenderServiceSoap.GetMap Method   |   Working with Map Views