com.esri.arcgis.carto
Interface IMap

All Superinterfaces:
Serializable
All Known Implementing Classes:
IMapProxy, Map

public interface IMap
extends Serializable

Provides access to members that control the map.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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.

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 object’s 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 is a 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 precision is calculated based on the union of all the layers extents.


Method Summary
 void addLayer(ILayer layer)
          Adds a layer to the map.
 void addLayers(IEnumLayer layers, boolean autoArrange)
          Adds multiple layers to the map, arranging them nicely if specified.
 void addMapSurround(IMapSurround mapSurround)
          Adds a map surround to the map.
 void clearLayers()
          Removes all layers from the map.
 void clearMapSurrounds()
          Removes all map surrounds from the map.
 void clearSelection()
          Clears the map selection.
 double computeDistance(IPoint p1, IPoint p2)
          Computes the distance between two points on the map and returns the result.
 IMapSurround createMapSurround(IUID clsid, IMapSurround optionalStyle)
          Create and initialize a map surround.
 void delayDrawing(boolean delay)
          Suspends drawing.
 void delayEvents(boolean delay)
          Used to batch operations together to minimize notifications.
 void deleteLayer(ILayer layer)
          Deletes a layer from the map.
 void deleteMapSurround(IMapSurround mapSurround)
          Deletes a map surround from the map.
 ILayer getActiveGraphicsLayer()
          The active graphics layer.
 IAnnotateMap getAnnotationEngine()
          The annotation (label) engine the map will use.
 IBarrierCollection getBarriers(IEnvelope pExtent)
          The list of barriers and their weight for labeling.
 IGraphicsLayer getBasicGraphicsLayer()
          The basic graphics layer.
 IBorder getClipBorder()
          An optional border drawn around ClipGeometry.
 IGeometry getClipGeometry()
          A shape that layers in the map are clipped to.
 String getDescription()
          Description of the map.
 int getDistanceUnits()
          The distance units for the map.
 ISelection getFeatureSelection()
          The feature selection for the map.
 ILayer getLayer(int index)
          The layer at the given index.
 int getLayerCount()
          Number of layers in the map.
 IEnumLayer getLayers(IUID uid, boolean recursive)
          The layers in the map of the type specified in the uid.
 double getMapScale()
          The scale of the map as a representative fraction.
 IMapSurround getMapSurround(int index)
          The map surround at the given index.
 int getMapSurroundCount()
          Number of map surrounds associated with the map.
 int getMapUnits()
          The units for the map.
 String getName()
          Name of the map.
 void getPageSize(double[] widthInches, double[] heightInches)
          Gets the page size for the map.
 double getReferenceScale()
          The reference scale of the map as a representative fraction.
 int getSelectionCount()
          Number of selected features.
 ISpatialReference getSpatialReference()
          The spatial reference of the map.
 boolean isExpanded()
          Indicates if the Map is expanded.
 boolean isFramed()
          Indicates if map is drawn in a frame rather than on the whole window.
 boolean isSpatialReferenceLocked()
          Indicates whether the spatial reference is prevented from being changed.
 boolean isUseSymbolLevels()
          Indicates if the Map draws using symbol levels.
 void moveLayer(ILayer layer, int toIndex)
          Moves a layer to another position.
 void recalcFullExtent()
          Forces the full extent to be recalculated.
 void selectByShape(IGeometry shape, ISelectionEnvironment env, boolean justOne)
          Selects features in the map given a shape and a selection environment (optional).
 void selectFeature(ILayer layer, IFeature feature)
          Selects a feature.
 void setActiveGraphicsLayerByRef(ILayer graphicsLayer)
          The active graphics layer.
 void setAnnotationEngineByRef(IAnnotateMap annotateMap)
          The annotation (label) engine the map will use.
 void setAreaOfInterest(IEnvelope rhs1)
          Area of interest for the map.
 void setClipBorder(IBorder border)
          An optional border drawn around ClipGeometry.
 void setClipGeometry(IGeometry clipGeometry)
          A shape that layers in the map are clipped to.
 void setDescription(String descr)
          Description of the map.
 void setDistanceUnits(int unitsCode)
          The distance units for the map.
 void setExpanded(boolean expanded)
          Indicates if the Map is expanded.
 void setFeatureSelectionByRef(ISelection selection)
          The feature selection for the map.
 void setIsFramed(boolean flag)
          Indicates if map is drawn in a frame rather than on the whole window.
 void setMapScale(double scaleRF)
          The scale of the map as a representative fraction.
 void setMapUnits(int unitsCode)
          The units for the map.
 void setName(String name)
          Name of the map.
 void setPageSize(double widthInches, double heightInches)
          Sets the page size for the map (optional).
 void setReferenceScale(double scaleRF)
          The reference scale of the map as a representative fraction.
 void setSpatialReferenceByRef(ISpatialReference spatialRef)
          The spatial reference of the map.
 void setSpatialReferenceLocked(boolean locked)
          Indicates whether the spatial reference is prevented from being changed.
 void setUseSymbolLevels(boolean flag)
          Indicates if the Map draws using symbol levels.
 

Method Detail

getName

public String getName()
               throws IOException,
                      AutomationException
Name of the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

Each map has a name controlled by this property.  The default name of the first map is 'Layers' and new maps get the name 'New Data Frame', 'New Data Frame 2' and so on. The name of each map appears in the Display and Source content views in the table of contents.

Returns:
The name
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setName

public void setName(String name)
             throws IOException,
                    AutomationException
Name of the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

Each map has a name controlled by this property.  The default name of the first map is 'Layers' and new maps get the name 'New Data Frame', 'New Data Frame 2' and so on. The name of each map appears in the Display and Source content views in the table of contents.

Parameters:
name - The name (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getDescription

public String getDescription()
                      throws IOException,
                             AutomationException
Description of the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

Each map has a description controlled by this property.  Maps do not have a description by default.

Returns:
The descr
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setDescription

public void setDescription(String descr)
                    throws IOException,
                           AutomationException
Description of the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

Each map has a description controlled by this property.  Maps do not have a description by default.

Parameters:
descr - The descr (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setAreaOfInterest

public void setAreaOfInterest(IEnvelope rhs1)
                       throws IOException,
                              AutomationException
Area of interest for the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

The AreaOfInterest property is not used by any object in ArcMap; this property exists solely for developer use.

Parameters:
rhs1 - An reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
ILayer.getAreaOfInterest()

getLayerCount

public int getLayerCount()
                  throws IOException,
                         AutomationException
Number of layers in the map.

Supported Platforms

Windows, Solaris, Linux

Description


 

Remarks

LayerCount returns the number of layers in the map that implement IDataLayer.

LayerCount does not include the basic graphics layer (CompositeGraphicLayer) that each map contains nor does it return the graphic layers that can be created into this composite layer.

Returns:
The count
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
IDataLayer

getLayer

public ILayer getLayer(int index)
                throws IOException,
                       AutomationException
The layer at the given index.

Supported Platforms

Windows, Solaris, Linux

Remarks

Maps are typically composed of numerous layers from various data sources.  Use the Layer property to access a particular layer in a map.  The collection of layers is 0-based.  Use the Layer property in conjunction with the LayerCount property to loop through all the layers in the map.

The Layer property returns an ILayer reference; attempt a Query Interface to determine the type of layer object.  For example, do not assume that all layers in a map are FeatureLayers. Valid layers are those that implement ILayer and IDataLayer.

Each Map also has a basic graphics layer (CompositeGraphicLayer) that is not comprised in the collection of layers returned by this property; a reference to this layer is obtainable through the BasicGraphicsLayer property.

Parameters:
index - The index (in)
Returns:
An reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
getLayerCount(), getBasicGraphicsLayer()

getLayers

public IEnumLayer getLayers(IUID uid,
                            boolean recursive)
                     throws IOException,
                            AutomationException
The layers in the map of the type specified in the uid. If recursive is true it will return layers in group layers.

Supported Platforms

Windows, Solaris, Linux

Description

UID specifies the interface identifier (GUID) that represents the type of layer you want returned.

recursive Use True to also return the layers inside group layers.

See the sample code associated with the FeatureSelection property for an example of use.

Remarks

The Layers property returns an IEnumLayer which consists of only those layers with the type specified by the input interface unique indentifier. The Layer property provides access to all of the Layers in a map; using the Layers property however, you can access just the layers of a particular type. For example, use this property to get a collection of FeatureLayers only. To create this collection use IGeoFeatureLayer's GUID as the FeatureLayer object is the only type of layer that implements this interface. Similarly, to get just a collection of the graphics layers, pass the IGraphicsLayer's GUID. Use IDataLayer if you want all the layers that have data in them, this would not include GroupLayers for example. Layers that implement IDataLayer include FeatureLayers, FDOGraphicsLayers (Annotation), TinLayer, RasterLayer, and CoverageAnnotationLayer.
Here are the GUIDs for some of the interfaces mentioned:
{6CA416B1-E160-11D2-9F4E-00C04F6BC78E} IDataLayer
{E156D7E5-22AF-11D3-9F99-00C04F6BC78E} IGeoFeatureLayer
{34B2EF81-F4AC-11D1-A245-080009B6F22B} IGraphicsLayer
{5CEAE408-4C0A-437F-9DB3-054D83919850} IFDOGraphicsLayer
{0C22A4C7-DAFD-11D2-9F46-00C04F6BC78E} ICoverageAnnotationLayer
{EDAD6644-1810-11D1-86AE-0000F8751720} IGroupLayer

Parameters:
uid - An reference to a com.esri.arcgis.system.IUID (in, optional, pass 0 if not required)
recursive - The recursive (in, optional, pass true if not required)
Returns:
An reference to a com.esri.arcgis.carto.IEnumLayer
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getMapSurroundCount

public int getMapSurroundCount()
                        throws IOException,
                               AutomationException
Number of map surrounds associated with the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

MapSurround objects include Legends, North Arrows, Scale Bars, and Scale Text. Use this property in conjunction with the MapSurround property to loop through all of the MapSurround objects associated with a Map.
See AddMapSurround for information on adding new MapSurrounds to a Map.
 

Returns:
The count
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
getMapSurround(int), addMapSurround(com.esri.arcgis.carto.IMapSurround)

getMapSurround

public IMapSurround getMapSurround(int index)
                            throws IOException,
                                   AutomationException
The map surround at the given index.

Supported Platforms

Windows, Solaris, Linux

Remarks

MapSurround objects include Legends, North Arrows, Scale Bars, and Scale Text.  Use this property in conjunction with the MapSurroundCount property to loop through all of the MapSurround objects associated with a Map.
The index is 0-based, ranging from 0 to MapSurroundCount - 1.
See AddMapSurround for information on adding new MapSurrounds to a Map.

Parameters:
index - The index (in)
Returns:
An reference to a com.esri.arcgis.carto.IMapSurround
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
getMapSurroundCount(), MapFrame, MapSurroundFrame

getMapUnits

public int getMapUnits()
                throws IOException,
                       AutomationException
The units for the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

MapUnits is the predefined enumeration (esriUnits) data type currently associated with the Map object.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are set as well.
When multiple layers are added simultaneously with AddLayers, the first spatial reference found is used.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.

Example

 

MapControl m = new MapControl();   
IMap pMap;   
ISpatialReference pSpatialReference;   
IProjectedCoordinateSystem pProjectedCoordinateSystem;   
ILinearUnit pLinearUnit;   
ISpatialReferenceInfo pSpatialReferenceInfo;

 

pMap = m.getMap();   
System.out.println(pMap.getMapUnits());
  
pSpatialReference = pMap.getSpatialReference();   
pProjectedCoordinateSystem =        
  new IProjectedCoordinateSystemProxy(pSpatialReference);
pLinearUnit = pProjectedCoordinateSystem.getCoordinateUnit();
pSpatialReferenceInfo =
  new ISpatialReferenceInfoProxy(pLinearUnit);   
System.out.println(pSpatialReferenceInfo.getFactoryCode());

Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setMapUnits

public void setMapUnits(int unitsCode)
                 throws IOException,
                        AutomationException
The units for the map.

Supported Platforms

Windows, Solaris, Linux

Parameters:
unitsCode - A com.esri.arcgis.system.esriUnits constant (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getDistanceUnits

public int getDistanceUnits()
                     throws IOException,
                            AutomationException
The distance units for the map.

Supported Platforms

Windows, Solaris, Linux

Description

The units - for example, feet, miles, meters, kilometers - ArcMap uses to report measurements, dimensions of shapes, and distance tolerances and offsets.

Remarks

DistanceUnits is the predefined enumeration (esriUnits) data type currently associated with the Map object.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties  are set as well.
When multiple layers are added simultaneously with AddLayers, the first spatial reference found is used.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.

Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setDistanceUnits

public void setDistanceUnits(int unitsCode)
                      throws IOException,
                             AutomationException
The distance units for the map.

Supported Platforms

Windows, Solaris, Linux

Parameters:
unitsCode - A com.esri.arcgis.system.esriUnits constant (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getSpatialReference

public ISpatialReference getSpatialReference()
                                      throws IOException,
                                             AutomationException
The spatial reference of the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are set and the extent of the screen display is recalculated.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When multiple layers are added simultaneously, AddLayer uses the first spatial reference it finds.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters as well.

Returns:
An reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setSpatialReferenceByRef

public void setSpatialReferenceByRef(ISpatialReference spatialRef)
                              throws IOException,
                                     AutomationException
The spatial reference of the map.

Parameters:
spatialRef - An reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getMapScale

public double getMapScale()
                   throws IOException,
                          AutomationException
The scale of the map as a representative fraction.

Supported Platforms

Windows, Solaris, Linux

Remarks

Scale is the relationship between the dimensions of features on a map and the geographic objects they represent on the earth, commonly expressed as a fraction or a ratio.  A map scale of 1/100,000 or 1:100,000 means that one unit of measure on the map equals 100,000 of the same units on the earth.
The MapScale property is really a shortcut to IDisplayTransformation::ScaleRatio.

Returns:
The scaleRF
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setMapScale

public void setMapScale(double scaleRF)
                 throws IOException,
                        AutomationException
The scale of the map as a representative fraction.

Supported Platforms

Windows, Solaris, Linux

Parameters:
scaleRF - The scaleRF (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getReferenceScale

public double getReferenceScale()
                         throws IOException,
                                AutomationException
The reference scale of the map as a representative fraction.

Supported Platforms

Windows, Solaris, Linux

Remarks

All symbols are drawn relative to the scale value set in this property.  By default this value is zero.  Symbol size is true at the reference scale.  When the reference scale is 0, symbols are always drawn at the same size regardless of the map scale (ScaleRatio).  For example, if you set your labels to display with 10 pt font, they will appear as 10 pt text at any map scale.  When the reference scale is greater than 0, symbols are drawn at a size relative to the map scale.  For example, if you set your labels to display with 10 pt font and have a reference scale of 10,000, the labels will appear as 10 pt only at that map scale; as you zoom in, the size of all symbols increases because the size of the symbols is based on the smaller scale.

The ReferenceScale property is a shortcut to IDisplayTransformation::ReferenceScale.

Returns:
The scaleRF
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setReferenceScale

public void setReferenceScale(double scaleRF)
                       throws IOException,
                              AutomationException
The reference scale of the map as a representative fraction.

Supported Platforms

Windows, Solaris, Linux

Parameters:
scaleRF - The scaleRF (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

isFramed

public boolean isFramed()
                 throws IOException,
                        AutomationException
Indicates if map is drawn in a frame rather than on the whole window.

Returns:
The flag
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setIsFramed

public void setIsFramed(boolean flag)
                 throws IOException,
                        AutomationException
Indicates if map is drawn in a frame rather than on the whole window.

Supported Platforms

Windows, Solaris, Linux

Parameters:
flag - The flag (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getClipGeometry

public IGeometry getClipGeometry()
                          throws IOException,
                                 AutomationException
A shape that layers in the map are clipped to.

Supported Platforms

Windows, Solaris, Linux

Remarks

Use the ClipGeometry  property to shape the area the Map is drawn in.  For example, if you had a map of the United States that contained many layers, you could set the Map's ClipGeometry equal to the geometry of a particular state thereby telling the map to only draw the map data falling within the particular state's area.

The scripts below demonstrate this. 

In the ArcMap user interface, the same functionality is available on the map's data frame properties page.  Right-click on a map in the table of contents and select Properties.  Select the Data Frame tab and look at 'Clip to Shape'.  Under 'Specify a Shape', select 'Outline of Data Graphics'.  You can also specify a 'Custom Extent' or use the 'Outline of Features'.

The ClipBorder property puts a border around the cut out.

By default there is no clip geometry and no clip border.

Example

 

MapControl pMapControl = new MapControl();   
IMap pMap;   
IViewManager pViewManager;   
IEnumElement pEnumElement;   
IElement pElement;   
IActiveView pActiveView;   
 IBorder pBorder;  
 
pMap = pMapControl.getMap();
pViewManager = new IViewManagerProxy(pMap);
pEnumElement = new IEnumElementProxy( pViewManager.getElementSelection());
pEnumElement.reset();
  
pElement = pEnumElement.next();
if(pElement != null){
   if(pElement.getGeometry().getGeometryType() == esriGeometryType.esriGeometryPolygon){
       pBorder = new SymbolBorder();
       pMap.setClipGeometry(pElement.getGeometry());
       pMap.setClipBorder(pBorder);
       pMapControl.getActiveView().refresh();
     }
   }

Returns:
An reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
setClipBorder(com.esri.arcgis.carto.IBorder)

setClipGeometry

public void setClipGeometry(IGeometry clipGeometry)
                     throws IOException,
                            AutomationException
A shape that layers in the map are clipped to.

Supported Platforms

Windows, Solaris, Linux

Parameters:
clipGeometry - An reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

addLayer

public void addLayer(ILayer layer)
              throws IOException,
                     AutomationException
Adds a layer to the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

The AddLayer method adds a layer to the Map. Use the LayerCount property to get the total number of layers in the map.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are additionally set.  AddLayer also sets the spatial reference of the layer (ILayer::SpatialReference ). 
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.
The full extent is recalculated each time a layer added.

Parameters:
layer - An reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
getLayerCount(), addLayers(com.esri.arcgis.carto.IEnumLayer, boolean)

addLayers

public void addLayers(IEnumLayer layers,
                      boolean autoArrange)
               throws IOException,
                      AutomationException
Adds multiple layers to the map, arranging them nicely if specified.

Supported Platforms

Windows, Solaris, Linux

Remarks

The AddLayers method adds all of the layers in the IEnumLayer enumeration to the Map. Use the LayerCount property to get the total number of layers in the map.  The autoArrange parameter controls the ordering of the layers.  If autoArrange is set to TRUE, the sequence of layers is by layer type - GraphicsLayer's on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.
AddLayers automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are additionally set.  AddLayers also sets the spatial reference for each layer (ILayer::SpatialReference). 
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.
The full extent is recalculated each time a layer added.

Parameters:
layers - An reference to a com.esri.arcgis.carto.IEnumLayer (in)
autoArrange - The autoArrange (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
getLayerCount(), addLayer(com.esri.arcgis.carto.ILayer)

deleteLayer

public void deleteLayer(ILayer layer)
                 throws IOException,
                        AutomationException
Deletes a layer from the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

DeleteLayer will automatically recalculate the Map's extent after the successful deletion of a layer.
Tip: If a layer is selected in the TOC window (IMxDocument::SelectedLayer), you can pass this to DeleteLayer.
 

Parameters:
layer - An reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

moveLayer

public void moveLayer(ILayer layer,
                      int toIndex)
               throws IOException,
                      AutomationException
Moves a layer to another position.

Supported Platforms

Windows, Solaris, Linux

Remarks

The MoveLayer method moves the layer to the position specified by the 0-based index. If the index is invalid, the layer is moved to the bottom.
MoveLayer automatically updates the contents view (TOC) but it does not update the map.
 

Example

MapControl pMapControl = new MapControl();     
IMap pMap = pMapControl.getMap();     
ILayer pLayer = pMap.getLayer(0);     
pLayer = pMap.moveLayer(pLayer, pMap.getLayerCount() - 1);

Parameters:
layer - An reference to a com.esri.arcgis.carto.ILayer (in)
toIndex - The toIndex (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

clearLayers

public void clearLayers()
                 throws IOException,
                        AutomationException
Removes all layers from the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

ClearLayers removes all layers types from the Map.  ClearLayers does not change or reset the Map's spatail reference however.  In addition, ClearLayers does not affect any graphics stored in the Map's BasicGaphicsLayer - it's not a true Layer.  ClearLayers does not update the contents view (TOC) or the display.

Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

createMapSurround

public IMapSurround createMapSurround(IUID clsid,
                                      IMapSurround optionalStyle)
                               throws IOException,
                                      AutomationException
Create and initialize a map surround. An optional style from the style gallery may be specified.

Supported Platforms

Windows, Solaris, Linux

Remarks

The CreateMapSurround method creates a new MapSurround object based on the required GUID parameter.  The optional style parameter specifies a partially initialized surround that comes from the style gallery.  For example, there are an entire collection of north arrows in the style gallery, use this parameter to specify the desired one.
CreateMapSurround automatically calls AddMapSurround to associate the new surround with the Map.
In the ArcMap application, the model for MapSurround objects is that each surround is contained by a separate MapSurroundFrame which has a relation to a MapFrame which holds the Map.  The CreateMapSurround method does not follow this model and is exposed for developers who want to create surrounds in a different window.  To keep with ArcMap's surround model, use IMapFrame::CreateSurroundFrame.  This method automatically creates a new MapSurroundFrame object with a MapSurround and associates them with the Map.

Parameters:
clsid - An reference to a com.esri.arcgis.system.IUID (in)
optionalStyle - An reference to a com.esri.arcgis.carto.IMapSurround (in)
Returns:
An reference to a com.esri.arcgis.carto.IMapSurround
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

addMapSurround

public void addMapSurround(IMapSurround mapSurround)
                    throws IOException,
                           AutomationException
Adds a map surround to the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

Use this method to associate a new MapSurround object with the Map.  Both IMap::CreateMapSurround and IMapFrame::CreateSurroundFrame automatically call this method to associate the surrounds they create with the Map.
Use IMap::MapSurroundCount to get the total number of surrounds associated with the Map.
 

Parameters:
mapSurround - An reference to a com.esri.arcgis.carto.IMapSurround (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

deleteMapSurround

public void deleteMapSurround(IMapSurround mapSurround)
                       throws IOException,
                              AutomationException
Deletes a map surround from the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

DeleteMapSurround method removes the MapSurround object from the Map and decrements the MapSurroundCount by 1.

Parameters:
mapSurround - An reference to a com.esri.arcgis.carto.IMapSurround (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

clearMapSurrounds

public void clearMapSurrounds()
                       throws IOException,
                              AutomationException
Removes all map surrounds from the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

The ClearMapSurrounds removes all of the surrounds associated with a Map thus resetting the MapSurroundCount to 0.

Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

computeDistance

public double computeDistance(IPoint p1,
                              IPoint p2)
                       throws IOException,
                              AutomationException
Computes the distance between two points on the map and returns the result.

Supported Platforms

Windows, Solaris, Linux

Description

ComputeDistance computes and returns the distance between two input points.  This method calculates the distance based on the current map units (IMap::MapUnits) and reports the distance using the current distance units (IMap::DistanceUnits).

Parameters:
p1 - An reference to a com.esri.arcgis.geometry.IPoint (in)
p2 - An reference to a com.esri.arcgis.geometry.IPoint (in)
Returns:
The distance
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
setMapUnits(int), setDistanceUnits(int)

getBasicGraphicsLayer

public IGraphicsLayer getBasicGraphicsLayer()
                                     throws IOException,
                                            AutomationException
The basic graphics layer.

Supported Platforms

Windows, Solaris, Linux

Remarks

Three different objects contain and persist graphic elements: a Map, the PageLayout, and an FDOGraphicsLayer.  Both the Map and the PageLayout store (persist) their graphics in the document; FDOGraphicsLayers store their graphics in a database (an FDOGraphics layer is a feature annotation layer).
In ArcMap, graphic elements are kept in graphics layers (GraphicLayers objects).  To manage all of the graphic layers, the Map has the CompositeGraphicsLayer object. The CompositeGraphicsLayer object has a collection of GraphicsLayers and it implements the ICompositeGraphicsLayer interface which provides methods for creating, finding, and deleting GraphicsLayers. New graphics layers are sometimes called 'Groups' or 'Annotation Target Layers'. 
Not only does the CompositeGraphicsLayer object have a collection of graphics layers, but it is itself a graphics layer - like the FDOGraphicsLayer object, it inherits from the GraphicsLayer object.  This means that the CompositeGraphicsLayer object has its own graphics container where graphic elements can be stored.  The graphics layer it provides is called the 'Basic Graphics Layer'.  This Basic Graphics Layer is the default graphics layer and it cannot be deleted.
The CompositeGraphicsLayer objects implements the ICompositeLayer interface, among others, which has the properties Count and Layer .  The Count does not include the Basic Graphics Layer and the Layer property cannot be used to access the Basic Graphics Layer.  This is because the Basic Graphics Layer is essentially the CompositeGraphicsLayer object whereas the Groups are separate GraphicsLayer objects.  The BasicGraphicsLayer property always returns a reference to the Basic Graphics Layer (the CompositeGraphicsLayer object) and from here you can query interface for the other interfaces implemented by the object including those on the GraphicsLayer object.
The Map's ActiveGraphicsLayer property provides a reference to the graphics layer currently active (sometimes this is called the 'Active Annotation Target Layer).  By default the basic graphics layer is the active layer but any Group or FDOGraphicsLayer can also be set as the active layer.
Neither the CompositeGraphicsLayer nor any of its GraphicsLayers (Groups) are real layers like a FeatureLayer, a GroupLayer, or an FDOGraphicsLayer.  None of these layers can be accessed with the Map's Layers property and they are not included in the Map's LayerCount.
 

Returns:
An reference to a com.esri.arcgis.carto.IGraphicsLayer
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
CompositeGraphicsLayer, getActiveGraphicsLayer()

getActiveGraphicsLayer

public ILayer getActiveGraphicsLayer()
                              throws IOException,
                                     AutomationException
The active graphics layer. If no graphic layers exist a basic memory graphics layer will be created.

Supported Platforms

Windows, Solaris, Linux

Remarks

Three different objects contain and persist graphic elements: a Map, the PageLayout, and an FDOGraphicsLayer.  Both the Map and the PageLayout store (persist) their graphics in the document; FDOGraphicsLayers store their graphics in a database (an FDOGraphics layer is a feature annotation layer).
In ArcMap, graphic elements are kept in graphics layers (GraphicLayers objects).  To manage all of the graphic layers, the Map has the CompositeGraphicsLayer object.  The CompositeGraphicsLayer object has a collection of GraphicsLayers and it implements the ICompositeGraphicsLayer interface which provides methods for creating, finding, and deleting GraphicsLayers.  New graphics layers are sometimes called 'Groups' or 'Annotation Target Layers'. 
Not only does the CompositeGraphicsLayer object have a collection of graphics layers, but it is itself a graphics layer - like the FDOGraphicsLayer object, it inherits from the GraphicsLayer object.  This means that the CompositeGraphicsLayer object has its own graphics container where graphic elements can be stored.  The graphics layer it provides is called the 'Basic Graphics Layer'.  This Basic Graphics Layer is the default graphics layer and it cannot be deleted.
The CompositeGraphicsLayer objects implements the ICompositeLayer interface, among others, which has the properties Count and Layer .  The Count does not include the Basic Graphics Layer and the Layer property cannot be used to access the basic graphics layer.  This is because the Basic Graphics Layer is essentially the CompositeGraphicsLayer object whereas the Groups are separate GraphicsLayer objects.  The BasicGraphicsLayer property always returns a reference to the Basic Graphics Layer (the CompositeGraphicsLayer object) and from here you can query interface for the other interfaces implemented by the object including those on the GraphicsLayer object.
The Map's ActiveGraphicsLayer property provides a reference to the graphics layer currently active (sometimes this is called the 'Active Annotation Target Layer).  By default the basic graphics layer is the active layer but any Group or FDOGraphicsLayer is also settable as the active layer.
The CompositeGraphicsLayer and none of its GraphicsLayers (Groups) are real layers like a FeatureLayer, a GroupLayer, or an FDOGraphicsLayer.  None of these layers can be accessed with the Map's Layers property and are not included in the LayerCount.

Returns:
An reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setActiveGraphicsLayerByRef

public void setActiveGraphicsLayerByRef(ILayer graphicsLayer)
                                 throws IOException,
                                        AutomationException
The active graphics layer. If no graphic layers exist a basic memory graphics layer will be created.

Parameters:
graphicsLayer - An reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getClipBorder

public IBorder getClipBorder()
                      throws IOException,
                             AutomationException
An optional border drawn around ClipGeometry.

Supported Platforms

Windows, Solaris, Linux

Remarks

If a ClipGeometry has been set, you have the option of drawing a border around the clipped map.  Use the ClipBorder propety to specify the type of border drawn.

Use the ClipGeometry property to shape the area the Map is drawn in.  For example, if you had a map of the United States that contained many layers, you could set the Map's ClipGeometry equal to the geometry of a particular state thereby telling the map to only draw the map data falling within the particular state's area.

By default there is no clip geometry or clip border.

In the ArcMap user interface, the functionality demonstrated in the example below is available on the map's data frame properties page.  Right-click on a map in the table of contents and select Properties.  Select the Data Frame tab and look at 'Clip to Shape'.  Under 'Specify a Shape', select 'Outline of Data Graphics'.  You can also specify a 'Custom Extent' or use the 'Outline of Features'.

Example

MapControl pMapControl = new MapControl();   
IMap pMap;   
IViewManager pViewManager;   
IEnumElement pEnumElement;   
IElement pElement;   
IActiveView pActiveView;   
IBorder pBorder;

  

pMap = pMapControl.getMap();   
pViewManager = new IViewManagerProxy(pMap);   
pEnumElement = new IEnumElementProxy( pViewManager.getElementSelection());   
pEnumElement.reset();

  

pElement = pEnumElement.next();   
if(pElement != null){     
  if(pElement.getGeometry().getGeometryType() == 
     esriGeometryType.esriGeometryPolygon){       
    pBorder = new SymbolBorder();       
    pMap.setClipGeometry(pElement.getGeometry());       
    pMap.setClipBorder(pBorder);       
    pMapControl.getActiveView().refresh();     
  }   
}

Returns:
An reference to a com.esri.arcgis.carto.IBorder
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.
See Also:
setClipGeometry(com.esri.arcgis.geometry.IGeometry)

setClipBorder

public void setClipBorder(IBorder border)
                   throws IOException,
                          AutomationException
An optional border drawn around ClipGeometry.

Supported Platforms

Windows, Solaris, Linux

Parameters:
border - An reference to a com.esri.arcgis.carto.IBorder (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

selectFeature

public void selectFeature(ILayer layer,
                          IFeature feature)
                   throws IOException,
                          AutomationException
Selects a feature.

Supported Platforms

Windows, Solaris, Linux

Remarks

Adds the feature to the feature layer's selection set. For example, the Editor's 'Create New Feature' task uses this method to select the new feature it has just created. This method also calls IActiveViewEvents::SelectionChanged to notify all listeners of the event.

Parameters:
layer - An reference to a com.esri.arcgis.carto.ILayer (in)
feature - An reference to a com.esri.arcgis.geodatabase.IFeature (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getSelectionCount

public int getSelectionCount()
                      throws IOException,
                             AutomationException
Number of selected features.

Supported Platforms

Windows, Solaris, Linux

Remarks

Returns the total number of selected features in the Map.  The selection total is calculated from all layers that implement IFeatureLayer.

Returns:
The count
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

clearSelection

public void clearSelection()
                    throws IOException,
                           AutomationException
Clears the map selection.

Supported Platforms

Windows, Solaris, Linux

Remarks

Unselects all features in all layers that implement IFeatureLayer and calls IActiveViewEvents::SelectionChanged to notify listeners the selection has changed.  If no features are selected initially, the event is not fired.
This method does not unselect graphic elements.

Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getFeatureSelection

public ISelection getFeatureSelection()
                               throws IOException,
                                      AutomationException
The feature selection for the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

ArcMap has two different selections, a feature selection and an element selection. Two different objects represent these selections and both implement the ISelection interface.  The feature selection object additionally implements IEnumFeature and the element selection object IEnumElement. The ISelection interface is used for clipboard type operations and the IEnum interfaces are used to loop through the items in the collection. 

When you ask for the FeatureSelection from IMap you are returned an ISelection but you can perform a query interface for IEnumFeature and usually do so. However, if you get the selection via IActiveView::Selection, the selection can either be an element selection or a feature selection depending on which one is currently active - only one of the selections can be active at a time.  Use FeatureSelection to ensure a reference to the correct selection.

IEnumFeature works on all of the FeatureLayers as a whole. Each FeatureLayer has a ISelectionSet and IEnumFeature steps through all of these as though there was only one. Because IEnumFeature works with all the FeatureLayers, you cannot use it to loop through the features belonging to just one FeatureLayer.

Note, only the shape field is guaranteed with the selection. This is the default and exists for performance reasons. The IMap::FeatureSelection property is typically used to draw the map selection, not access feature attributes. This is particularly noticeable with shapefiles and coverage but also in geodatabases if the selection is large enough. Use IEnumFeatureSetup::AllFields to set a flag indicating all fields be returned with the selection. If you want to loop through the map selection to perform an operation, it is typically best to access each layer's selection rather than the entire map's selection. See the example for a sample of each.

Returns:
An reference to a com.esri.arcgis.carto.ISelection
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setFeatureSelectionByRef

public void setFeatureSelectionByRef(ISelection selection)
                              throws IOException,
                                     AutomationException
The feature selection for the map.

Parameters:
selection - An reference to a com.esri.arcgis.carto.ISelection (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

selectByShape

public void selectByShape(IGeometry shape,
                          ISelectionEnvironment env,
                          boolean justOne)
                   throws IOException,
                          AutomationException
Selects features in the map given a shape and a selection environment (optional).

Supported Platforms

Windows, Solaris, Linux

Remarks

SelectByShape searches for features in all layers of type IFeatureLayer, that are intersected by the input shape.  Each layer is searched only if its IFeatureLayer::Selectable property is set to TRUE. 

The ISelectionEnvironment parameter determines the selection outcome.  For example, a new selection may be created or the features found may be added to the existing feature selection.  See the esriSelectionOption enumeration for the different selection options.  The application's selection environment is available via IMxApplication::SelectionEnvironment.

The justOne parameter tells the search to stop once it has found one feature.

After the search is complete, IActiveViewEvents::SelectionChanged is called to notify all listeners the selection has changed.

Parameters:
shape - An reference to a com.esri.arcgis.geometry.IGeometry (in)
env - An reference to a com.esri.arcgis.carto.ISelectionEnvironment (in)
justOne - The justOne (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

delayEvents

public void delayEvents(boolean delay)
                 throws IOException,
                        AutomationException
Used to batch operations together to minimize notifications.

Supported Platforms

Windows, Solaris, Linux

Remarks

All calls made to IActiveViewEvents::SelectionChanged are ignored when DelayEvents is set to TRUE.  The event is automatically fired when DelayEvents is set back to FALSE to ensure that clients ultimately receive the event.

This method is typically used when changing the Map's selection.  Without DelayEvents set to TRUE, the SelectionChanged event would fire each time a feature is added or removed; instead, DelayEvents is used so that only one notification is sent when the entire selection operation is complete.

Parameters:
delay - The delay (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setPageSize

public void setPageSize(double widthInches,
                        double heightInches)
                 throws IOException,
                        AutomationException
Sets the page size for the map (optional).

Parameters:
widthInches - The widthInches (in)
heightInches - The heightInches (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getPageSize

public void getPageSize(double[] widthInches,
                        double[] heightInches)
                 throws IOException,
                        AutomationException
Gets the page size for the map.

Supported Platforms

Windows, Solaris, Linux

Remarks

GetPageSize returns the width and height of the Map in inches.
In the ArcMap application, the Map width and height are set to 0 inches by 0 inches in data view; in layout view, the Map's size is by default set to fit within the page size (IPage::QuerySize).
Developers creating their own application may use SetPageSize to set the size of the Map in their own page space.

Parameters:
widthInches - The widthInches (out: use single element array)
heightInches - The heightInches (out: use single element array)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getBarriers

public IBarrierCollection getBarriers(IEnvelope pExtent)
                               throws IOException,
                                      AutomationException
The list of barriers and their weight for labeling.

Supported Platforms

Windows, Solaris, Linux

Remarks

Returns a reference to the BarrierCollection object.  The BarrierCollection object contains a collection of geometries used for over posting calculations during labeling.  An item in the BarrierCollection is made up of a GeometryCollection and a Weight.  Each item corresponds to a graphics layer and the geometries of all the graphics in that layer are stored in the GeometryCollection.  The Weight is an esriBasicOverPosterWeight and it stores the level of importance a barrier item has.

A map that has no labels or annotation can still have a IBarrierCollection::Count of one.  This is because every Map has a Basics Graphics Layer which cannot be deleted and this layer has a barrier weight by default.  Each additional graphics layer, feature annotation layer (FDOGraphicsLayer) or a Annotation Group/Target Layer (GraphicsLayer), added to the Map will increase the Count by one.

The Barriers property requires an IEnvelope.  Use IDisplayTransformation::Bounds to get an IEnvelope that represents the Map's full extent.  If you are labelling in just a small area use IDisplayTransformation::FittedBounds which is the current view extent.

 

esriBasicOverposterWeight

0 - esriNoWeight - ok to over post
1 - esriLowWeight
2 - esriMediumWeight
3 - esriHighWeight - do not over post

Parameters:
pExtent - An reference to a com.esri.arcgis.geometry.IEnvelope (in)
Returns:
An reference to a com.esri.arcgis.carto.IBarrierCollection
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setUseSymbolLevels

public void setUseSymbolLevels(boolean flag)
                        throws IOException,
                               AutomationException
Indicates if the Map draws using symbol levels.

Supported Platforms

Windows, Solaris, Linux

Remarks

UseSymbolLevels flag indicates if the order of symbols is to be drawn by their assign level value. When the flag is TRUE, symbols with lower level values get to be drawn first on the screen.

Parameters:
flag - The flag (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

isUseSymbolLevels

public boolean isUseSymbolLevels()
                          throws IOException,
                                 AutomationException
Indicates if the Map draws using symbol levels.

Supported Platforms

Windows, Solaris, Linux

Description

Determines whether Symbol Level Drawing is enabled for a Map.

Remarks

Symbol Level Drawing is useful when creating large scale maps with intersecting and overlapping line features. For example, on a large scale reference map with intersecting highways and streets, Symbol Level Drawing helps you create high-quality representations of the street and highway street intersections.

To set up Symbol Level Drawing:

  1. Turn on Symbol Level Drawing using either for your layer using ISymbolLevels::UseSymbolLevels, or for your entire map using IMap::UseSymbolLevels.
  2. For each layer that you want to set up symbol levels for, access that layer's renderer using IGeoFeatureLayer::Renderer.
  3. Access your layer's symbol(s) through the renderer.
  4. Using IMapLevel, set symbol levels on your layer's symbols. Symbols with MapLevel = 0 draw first, then symbols with MapLevel = 1, continuing until the highest MapLevel is reached. If two symbols have the same MapLevel, then the features drawn with these symbols are drawn in the normal layer order. A MapLevel of -1 for a multilayer symbol (MultiLayerMarkerSymbol, MultiLayerLineSymbol, MultiLayerFillSymbol) indicates that each of the symbol's individual layers are drawn with their individual MapLevel .

Returns:
The flag
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setExpanded

public void setExpanded(boolean expanded)
                 throws IOException,
                        AutomationException
Indicates if the Map is expanded.

Supported Platforms

Windows, Solaris, Linux

Parameters:
expanded - The expanded (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

isExpanded

public boolean isExpanded()
                   throws IOException,
                          AutomationException
Indicates if the Map is expanded.

Supported Platforms

Windows, Solaris, Linux

Remarks

Use this property to expand or collapse the Map in the table of contents.  By default a Map is expanded.

Returns:
The expanded
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setAnnotationEngineByRef

public void setAnnotationEngineByRef(IAnnotateMap annotateMap)
                              throws IOException,
                                     AutomationException
The annotation (label) engine the map will use.

Parameters:
annotateMap - An reference to a com.esri.arcgis.carto.IAnnotateMap (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

getAnnotationEngine

public IAnnotateMap getAnnotationEngine()
                                 throws IOException,
                                        AutomationException
The annotation (label) engine the map will use.

Supported Platforms

Windows, Solaris, Linux

Returns:
An reference to a com.esri.arcgis.carto.IAnnotateMap
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

recalcFullExtent

public void recalcFullExtent()
                      throws IOException,
                             AutomationException
Forces the full extent to be recalculated.

Supported Platforms

Windows, Solaris, Linux

Remarks

Recalculates the Map's full extent so that all of the Map's feature layers, fall within its bounds.

AddLayer, AddLayers, and DeleteLayer all call RecalcFullExtent automatically.

Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

delayDrawing

public void delayDrawing(boolean delay)
                  throws IOException,
                         AutomationException
Suspends drawing.

Supported Platforms

Windows, Solaris, Linux

Parameters:
delay - The delay (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

setSpatialReferenceLocked

public void setSpatialReferenceLocked(boolean locked)
                               throws IOException,
                                      AutomationException
Indicates whether the spatial reference is prevented from being changed.

Supported Platforms

Windows, Solaris, Linux

Parameters:
locked - The locked (in)
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.

isSpatialReferenceLocked

public boolean isSpatialReferenceLocked()
                                 throws IOException,
                                        AutomationException
Indicates whether the spatial reference is prevented from being changed.

Supported Platforms

Windows, Solaris, Linux

Returns:
The locked
Throws:
IOException - If there are communications problems.
AutomationException - If the remote server throws an exception.