MapView Class
MapView Class
An abstract class representing a requested map view.
Public MustInherit Class MapView Inherits System.Object
[C#]
public abstract class MapView : System.Object
Remarks
Each of the following derived classes defines a map view using a different measure—a set of location points, a bounding rectangle, height and width, or scale:
You can only use the MapView class as one of its derived types or as an array of different types. The MapView class has no properties of its own.
The MapView class is passed to the RenderServiceSoap.GetMap method.
Example
[Visual Basic]
'Use four different views to return four maps
Dim myViews(3) As MapView
Dim view1 As New ViewByScale()
Dim view2 As New ViewByBoundingRectangle()
Dim view3 As New ViewByHeightWidth()
Dim view4 As New ViewByBoundingLocations()
view1.MapScale = 20000
view1.CenterPoint = New LatLong()
view1.CenterPoint.Latitude = 40
view1.CenterPoint.Longitude = -120
view2.BoundingRectangle = New LatLongRectangle()
view2.BoundingRectangle.Northeast = New LatLong()
view2.BoundingRectangle.Southwest = New LatLong()
view2.BoundingRectangle.Northeast.Latitude = 41
view2.BoundingRectangle.Northeast.Longitude = -121
view2.BoundingRectangle.Southwest.Latitude = 40
view2.BoundingRectangle.Southwest.Longitude = -122
view3.CenterPoint = New LatLong()
view3.CenterPoint.Latitude = 40
view3.CenterPoint.Longitude = -120
view3.Height = 300
view3.Width = 200
Dim myLocations(1) As Location
myLocations(0) = New Location()
myLocations(1) = New Location()
myLocations(0).LatLong = New LatLong()
myLocations(1).LatLong = New LatLong()
myLocations(0).LatLong.Latitude = 40
myLocations(0).LatLong.Longitude = -120
myLocations(1).LatLong.Latitude = 41
myLocations(1).LatLong.Longitude = -121
view4.Locations = myLocations
myViews(0) = view1
myViews(1) = view2
myViews(2) = view3
myViews(3) = view4
Dim mapSpec As New MapSpecification()
mapSpec.DataSourceName = "MapPoint.NA"
mapSpec.Views = myViews
Dim mapImages() As MapImage
mapImages = renderService.GetMap(mapSpec)
[C#]
//Use four different views to return four maps
MapView[] myViews = new MapView[4];
ViewByScale view1 = new ViewByScale();
ViewByBoundingRectangle view2 = new ViewByBoundingRectangle();
ViewByHeightWidth view3 = new ViewByHeightWidth();
ViewByBoundingLocations view4 = new ViewByBoundingLocations();
view1.MapScale = 20000;
view1.CenterPoint = new LatLong();
view1.CenterPoint.Latitude = 40;
view1.CenterPoint.Longitude = -120;
view2.BoundingRectangle = new LatLongRectangle();
view2.BoundingRectangle.Northeast = new LatLong();
view2.BoundingRectangle.Southwest = new LatLong();
view2.BoundingRectangle.Northeast.Latitude = 41;
view2.BoundingRectangle.Northeast.Longitude = -121;
view2.BoundingRectangle.Southwest.Latitude = 40;
view2.BoundingRectangle.Southwest.Longitude = -122;
view3.CenterPoint = new LatLong();
view3.CenterPoint.Latitude = 40;
view3.CenterPoint.Longitude = -120;
view3.Height = 300;
view3.Width = 200;
Location[] myLocations = new Location[2];
myLocations[0] = new Location();
myLocations[1] = new Location();
myLocations[0].LatLong = new LatLong();
myLocations[1].LatLong = new LatLong();
myLocations[0].LatLong.Latitude = 40;
myLocations[0].LatLong.Longitude = -120;
myLocations[1].LatLong.Latitude = 41;
myLocations[1].LatLong.Longitude = -121;
view4.Locations = myLocations;
myViews[0] = view1;
myViews[1] = view2;
myViews[2] = view3;
myViews[3] = view4;
MapSpecification mapSpec = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
MapImage[] mapImages = renderService.GetMap(mapSpec);
See Also
ViewByBoundingLocations Class | ViewByBoundingRectangle Class | ViewByHeightWidth Class | ViewByScale Class | RenderServiceSoap.GetMap Method