Provides access to the Center And Size Map Area Interface.
When To Use
Use ICenterAndSize to apply a new geographic extent to a map by specifying a center point and the height and width of the map image.
Members
Name | Description | |
---|---|---|
Center | The center of the map. | |
Height | The height of the map expressed in map units. | |
Units | The current map units. | |
Width | The width of the map expressed in map units. |
ICenterAndSize.Center Property
The center of the map.
Public Property Center As IPoint
public IPoint Center {get; set;}
ICenterAndSize.Height Property
The height of the map expressed in map units.
Public Property Height As Double
public double Height {get; set;}
ICenterAndSize.Units Property
The current map units.
Public Property Units As esriUnits
public esriUnits Units {get; set;}
ICenterAndSize.Width Property
The width of the map expressed in map units.
Public Property Width As Double
public double Width {get; set;}
Classes that implement ICenterAndSize
Classes | Description |
---|---|
CenterAndSize | The Center And Size coclass allows you to change the spatial extent of a map by specifying the center, size and units. |
Remarks
One way to change the map extent is using the object CenterAndSize. Create a new CenterAndSize object and set the geographic extent by setting a center point, the height and the width of the map image. The height and width will be in map units. If the spatial reference of the map has changed, remember to adjust the center point coordinates and height and width units accordingly.
If the aspect ratio of the input map is different from the aspect ratio of the requested image, the returned map extent will be adjusted to fit the requested image.
The following sample code shows how to change the geographic height and width of the map image using ICenterAndSize. It assumes that you already have a valid MapServerInfo and MapDescription object, and that you are not working with a server context. However, if you are developing an ArcGIS for Server application using a server context, you should not use New to create local ArcObjects, but you should always create objects within the server by calling CreateObject on IServerContext.