IFeatureExtent Interface

Provides access to the Feature Extent Map Area Interface.

When To Use

Use IFeatureExtent to zoom to selected features of a layer.

Members

Name Description
Read/write property DefaultScale Scale at which the extent of a single point is drawn.
Read/write property ExpandRatio Ratio used to expand the extent.
Read/write property FeatureIDs The set of feature IDs.
Read/write property LayerID The ID of the layer.
Read/write property MapName Name of the map (data frame).

IFeatureExtent.DefaultScale Property

Scale at which the extent of a single point is drawn.

Public Property DefaultScale As Double
public double DefaultScale {get; set;}

Remarks

Use DefaultScale to control the map scale when zooming to a single point feature. The DefaultScale value only affects conditions where a single point feature is selected. This value will be ignored when selecting multiple points or when selecting other feature types. If this value is not set and FeatureIDs is comprised of a single point feature, the new spatial extent may be too large.

IFeatureExtent.ExpandRatio Property

Ratio used to expand the extent.

Public Property ExpandRatio As Double
public double ExpandRatio {get; set;}

Remarks

Use ExpandRatio to add a "buffer" around the requested geographic extent. For example, an ExpandRatio value of 1.5 will expand the map extent by 1.5 times.ExpandRatio should be used to ensure that the set of features can be viewed easily. Otherwise, some features may be at the very edge of the displayed map extent. If the ExpandRatio is not set (the default value is 1) some of the selected features will be located at the very edge of the map image. A number greater than 1 will "zoom out", providing a spatial buffer around the selected features. A number less than 1 will "zoom in".

IFeatureExtent.FeatureIDs Property

The set of feature IDs.

Public Property FeatureIDs As IFIDSet
public IFIDSet FeatureIDs {get; set;}

IFeatureExtent.LayerID Property

The ID of the layer.

Public Property LayerID As Integer
public int LayerID {get; set;}

IFeatureExtent.MapName Property

Name of the map (data frame).

Public Property MapName As String
public string MapName {get; set;}

Classes that implement IFeatureExtent

Classes Description
FeatureExtent The Feature Extent coclass allows you to zoom to selected features in a layer.

Remarks

To use a FeatureExtent, the properties MapName, LayerID and FeatureIDs need to be set. You are likely to get unexpected results if these properties are not set. The ExpandRatio and DefaultScale properties are optional. If the ExpandRatio is not set some of the selected features will be located at the very edge of the map image. The DefaultScale value only affects conditions where a single point feature is selected. This will be the map scale in which the map will zoom to when a single point is selected.

The following sample code shows how to zoom to selected features of a layer using IFeatureExtent. It assumes that you already have a valid MapServer 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.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.