Share via


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 Dim View As [Namespace].MapViewRepresentations
    Member of [Namespace].MapImage
[C#]
public [Namespace].MapViewRepresentations View
    Member of [Namespace].MapImage

Remarks

Example

 
[Visual Basic] 
'This example assumes that the service instance 
''renderService' has already been created and that 
'the MapPoint Web Service namespace has been imported 

'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#]
//This example assumes that the service instance 
//'renderService' has already been created and that 
//the MapPoint Web Service namespace has been imported 

//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