ArcObjects Library Reference (Carto)  

IMap Interface

Provides access to members that control the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

When To Use

Use the IMap interface to display data from various data sources.

The IMap interface is a starting point for many of the tasks one does with a Map. For example, use IMap to add, delete, and access map layers containing data from various sources including feature layers and graphics layers; associate map surround objects (legends, scale bars, etc) with the Map; access the various properties of a Map including the area of interest, the current map units, and the spatial reference; select features and access the Map's current selection.

Members

Description
Read/write property ActiveGraphicsLayer The active graphics layer. If no graphic layers exist a basic memory graphics layer will be created.
Method AddLayer Adds a layer to the map.
Method AddLayers Adds multiple layers to the map, arranging them nicely if specified.
Method AddMapSurround Adds a map surround to the map.
Read/write property AnnotationEngine The annotation (label) engine the map will use.
Write-only property AreaOfInterest Area of interest for the map.
Read-only property Barriers The list of barriers and their weight for labeling.
Read-only property BasicGraphicsLayer The basic graphics layer.
Method ClearLayers Removes all layers from the map.
Method ClearMapSurrounds Removes all map surrounds from the map.
Method ClearSelection Clears the map selection.
Read/write property ClipBorder An optional border drawn around ClipGeometry.
Read/write property ClipGeometry A shape that layers in the map are clipped to.
Method ComputeDistance Computes the distance between two points on the map and returns the result.
Method CreateMapSurround Create and initialize a map surround. An optional style from the style gallery may be specified.
Method DelayDrawing Suspends drawing.
Method DelayEvents Used to batch operations together to minimize notifications.
Method DeleteLayer Deletes a layer from the map.
Method DeleteMapSurround Deletes a map surround from the map.
Read/write property Description Description of the map.
Read/write property DistanceUnits The distance units for the map.
Read/write property Expanded Indicates if the Map is expanded.
Read/write property FeatureSelection The feature selection for the map.
Method GetPageSize Gets the page size for the map.
Read/write property IsFramed Indicates if map is drawn in a frame rather than on the whole window.
Read-only property Layer The layer at the given index.
Read-only property LayerCount Number of layers in the map.
Read-only property Layers The layers in the map of the type specified in the uid. If recursive is true it will return layers in group layers.
Read/write property MapScale The scale of the map as a representative fraction.
Read-only property MapSurround The map surround at the given index.
Read-only property MapSurroundCount Number of map surrounds associated with the map.
Read/write property MapUnits The units for the map.
Method MoveLayer Moves a layer to another position.
Read/write property Name Name of the map.
Method RecalcFullExtent Forces the full extent to be recalculated.
Read/write property ReferenceScale The reference scale of the map as a representative fraction.
Method SelectByShape Selects features in the map given a shape and a selection environment (optional).
Method SelectFeature Selects a feature.
Read-only property SelectionCount Number of selected features.
Method SetPageSize Sets the page size for the map (optional).
Read/write property SpatialReference The spatial reference of the map.
Read/write property SpatialReferenceLocked Indicates whether the spatial reference is prevented from being changed.
Read/write property UseSymbolLevels Indicates if the Map draws using symbol levels.

CoClasses that implement IMap

CoClasses and Classes Description
Globe (esriGlobeCore) A container for the display and manipulation of data in the Globe.
Map A container for the display and manipulation of map data.
Scene (esri3DAnalyst) A container for the display and manipulation of data.

Remarks

The IMap interface is a starting point for many of the tasks one does with a map. For example, you can use IMap to add, delete, and access map layers containing data from various sources, including feature layers and graphics layers; associate map surround objects (legends, scale bars, and so on) with the map; access the various properties of a map, including the area of interest, the current map units, and the spatial reference; select features and access the Map objects current selection.

Every map document contains at least one Map object. Only one Map can have focus at a time, and this Map is called the focus map. IMxDocument provides access to all of the Map objects loaded in the document; IMxDocument::FocusMap returns a reference (IMap) to the Map currently with focus, and IMxDocument::Maps returns a reference (IMaps) to the entire collection of Map objects. A map document can contain any number of Map objects the focus map always represents the data view.

The Map object, manages a collection of Layer objects. Each layer has a spatial reference. A spatial reference defines a resolution (1/precision) and a coordinate system. The map coordinate system is automatically set to the coordinate system of the first layer loaded in the map and the resolution (1/precision) is calculated based on the union of all the layers extents.

See Also

IMxDocument.FocusMap Property | IMxDocument.Maps Property | IMaps Interface