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

.NET Snippets

Get MxApplication from ArcMap | Toggle to Dynamic Display | Get All Features from Point Search in GeoFeatureLayer | Add North Arrow | Add Scale Bar | Add GeoDataset Raster To Map | Add Hyperlink | Add Layer File to ActiveView | Toggle Visibility Of Composite Layer | Add Legend | Get Map from ArcMap | Add Event Wiring for All IActiveViewEvents | Change Map Spatial Reference | Get FeatureLayer from Layer Index Number | Do Identify | Zoom to Layer by Index Number | Get BasicMap from Map | Get GeoFeatureLayer from Layer Index Number | Add Tracking Layer To Map | Add Graphic to Map | TimeControl Playback | Loop Through Layers of Specific UID | Set Data Source | Create Graphic Buffers around Selected Features | Get Index Number from Layer Name | Get First Feature from Point Search in GeoFeatureLayer |

.NET Samples

Applying a time offset to a time-aware feature layer (Code Files: TimeOffsetButton) | Buffer snap agent (Code Files: BufferSnap) | Change layer rendering using the SymbologyControl (Code Files: LayerRendering) | Closest facility application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ClosestFacility_GISServerAPIClass) | Committing ink sketches using the controls ink commands (Code Files: InkSketchCommit) | Convert part to feature command (Code Files: ConvertPart) | Copy the PageLayoutControl focus map and overwrite the MapControl map (Code Files: CopyFocusMap) | Create a custom selection extension by extending ArcObjects (Code Files: SelectionExtension ZoomToLayerMultiItem) | Create a custom tool (Code Files: DrawGraphicLine) | Custom map navigation commands (Code Files: Pan ZoomIn ZoomOut) | Custom map selection commands (Code Files: SelectFeatures) | Custom selection extension (Code Files: SelectionExtension ZoomToLayerMultiItem) | Custom UI elements using add-ins (Code Files: AddGraphicsTool) | Displaying a TOCControl context menu (Code Files: TOCContextMenuForm) | Dynamic cache layer manager controller (Code Files: CacheManagerDlg) | Dynamic logo (Code Files: DynamicLogo) | Editing using a custom form (Code Files: EditorForm) | Geodesy MapControl (Code Files: GeodesyMapControl) | Graphics layers ToolControl (Code Files: GraphicsLayersListCtrl NewGraphicsLayerCmd) | Implementing a property page for an ArcGIS Engine application (Code Files: CreateNewDocument) | Implementing a schematic digitizing tool (Code Files: DigitTool) | Implementing an XML builder external component (Code Files: XMLDocImpl) | Layer filtering TOC view (Code Files: TOCLayerFilter) | Make a custom time slider (Code Files: CustomTimeSliderButton) | Move a graphic along a path in ArcMap (Code Files: cmdMoveGraphicAlongPath) | Multivariate renderer (Code Files: MultivariateRendPropPage PropPageForm) | Route application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: Route_GISServerAPIClass) | Save a layer file in a MapControl application (Code Files: CreateNewDocument) | Schematic diagram auto refresh (Code Files: FormAutorefresh) | Schematics Engine application (Code Files: CreateNewDocument MainForm) | Selection restriction evaluator (Code Files: SelectionRestrictionEvaluator) | Server spatial query COM utility (Code Files: VegTool_VBNet) | Server spatial query server object extension (Code Files: Configurator Extension PropertyForm) | Service area application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ServiceArea_GISServerAPIClass) | Set the time extents for a layer then render the layer (Code Files: SetTimeExtentsButton) | Simple dynamic display application (Code Files: CreateNewDocument) | Subset network evaluators (Code Files: AutoUpdateNetworkElementArrayParametersCommand SubsetHelperUI) | Synchronized MapControl and PageLayoutControl application (Code Files: ControlsSynchronizer frmMain Maps OpenNewMapDocument) | Temporal statistics (Code Files: CreateNewDocument) | Using the traversal result to select source features (Code Files: SelectFeaturesTool) |

.NET Related Topics

Add-in coding patterns | Adjusting feature locations with spatial adjustment | CatalogUI | Converting labels to geodatabase annotation for a single layer | Converting labels to geodatabase annotation for an entire map | Converting labels to map annotation for a single layer | Create a custom tool | Creating and working with basemap layers | GeoData services | How to access maps and layers via the MapDocument | How to access maps and layers via the MxDocument | How to add a layer to a map from a layer file | How to add different types of layers to a map | How to create a mosaic layer | How to create a raster catalog layer | How to create a raster layer | How to create an edit session | How to create AOIs and bookmarks | How to create map grids | How to create SOE property pages | How to develop the SOE | How to use symbol level drawing | How to wire custom events using IActiveViewEvents | LocationUI | Managing application state | Map services | Maplex | Performing basic map functions | Performing map selection | Persisting cache information for use in dynamic display | Programming with server objects | Releasing COM references | Server object extensions (SOE) | Using ArcObjects as tool input | Using the TOCControl | Utility COM objects | Working with map elements | Working with map surrounds | Working with PageLayout elements |