com.esri.arcgis.carto
Interface IMap

All Superinterfaces:
Serializable
All Known Implementing Classes:
Globe, Map, Scene

public interface IMap
extends Serializable

Provides access to members that control the map.

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 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.

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.

Product Availability

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

See Also:
com.esri.arcgis.carto.IMxDocument, IMaps

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

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDescription

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The descr
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDescription

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
descr - The descr (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAreaOfInterest

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

Remarks

The AreaOfInterest is used as the "custom full extent" by the map. The map's full extent will return this value if it is set.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
rhs1 - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILayer.getAreaOfInterest()

getLayerCount

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDataLayer

getLayer

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

Product Availability

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

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayers

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.

Product Availability

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

Parameters:
uid - A 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:
A reference to a com.esri.arcgis.carto.IEnumLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapSurroundCount

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getMapSurround

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

Product Availability

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

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapSurround
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapUnits

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

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());

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMapUnits

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getDistanceUnits

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.system.esriUnits constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDistanceUnits

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSpatialReference

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSpatialReferenceByRef

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
spatialRef - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapScale

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The scaleRF
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMapScale

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
scaleRF - The scaleRF (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getReferenceScale

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The scaleRF
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setReferenceScale

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
scaleRF - The scaleRF (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFramed

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

Remarks

When creating a custom application, if you want the display to take over the window it's drawing in, set IsFramed to FALSE. This will add scrollbars (IScreenDisplay::UseScrollBars = TRUE) as necessary and keeps the device frame in sync with the window extent. Setting IsFramed to TRUE means that the display is drawing on some extent within the window. In this case, it won't show scrollbars and it won't automatically update the device frame.

For example, in the ArcMap application, in layout view where each Map resides inside a separate MapFrame, each Map has it IsFramed property set to TRUE. In data view, the opposite is true, a Map's display fits the entire window; in this view, all Map's have IsFramed set to FALSE, not just the focus map.

The IsFramed property also sets the IsFirstCacheTransparent property. When a Map is drawing in layout view, the PageLayout object has its ScreenDisplay and each Map has its own separate ScreenDisplay. This means that the layout has it's display cache(s) and the maps have their own. If the bottom cache of each map was opaque, you wouldn't be able to see through a map onto layout elements below it. Setting IsFirstCacheTransparent on the maps in layout view lets you see through the maps.

This property is really a shortcut to IScreenDisplay::IsFramed.

If you are working with Map's inside of ArcMap these settings should not be touched. Only use this property when building a low level appliation that uses a display to draw on a frame on a window.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
com.esri.arcgis.carto.IScreenDisplay

setIsFramed

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
flag - The flag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClipGeometry

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

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();
}
}

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.getClipBorder()

setClipGeometry

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
clipGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLayer

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.addLayers(com.esri.arcgis.carto.IEnumLayer, boolean), IMap.getLayerCount()

addLayers

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

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 layers are added in the proper position as by their weight specified via ILayerPosition::LayerWeight. By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers. If autoArrange is true for this method, the position passed in is ignored as the position is determined by the auto arrange logic.
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.
The full extent is recalculated each time a layer added.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
layers - A reference to a com.esri.arcgis.carto.IEnumLayer (in)
autoArrange - The autoArrange (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.addLayer(com.esri.arcgis.carto.ILayer), IMap.getLayerCount()

deleteLayer

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

Remarks

DeleteLayer will automatically recalculate the Map's extent after the successful deletion of a layer.
Tips:
If a layer is selected in the TOC window (IMxDocument::SelectedLayer), you can pass this to DeleteLayer.
When deleting a layer that references a feature class, like a FeatureLayer, executing IDataLayer2::Disconnect will ensure that references to the feature class are cleared.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

moveLayer

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

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);

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
toIndex - The toIndex (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearLayers

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createMapSurround

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.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
clsid - A reference to a com.esri.arcgis.system.IUID (in)
optionalStyle - A reference to a com.esri.arcgis.carto.IMapSurround (in)
Returns:
A reference to a com.esri.arcgis.carto.IMapSurround
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.createMapSurround(com.esri.arcgis.system.IUID, com.esri.arcgis.carto.IMapSurround), IMap.deleteMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.addMapSurround(com.esri.arcgis.carto.IMapSurround), IMapFrame.createSurroundFrame(com.esri.arcgis.system.IUID, com.esri.arcgis.carto.IMapSurround), IMap.clearMapSurrounds()

addMapSurround

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
mapSurround - A reference to a com.esri.arcgis.carto.IMapSurround (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.createMapSurround(com.esri.arcgis.system.IUID, com.esri.arcgis.carto.IMapSurround), IMap.deleteMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.addMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.clearMapSurrounds()

deleteMapSurround

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
mapSurround - A reference to a com.esri.arcgis.carto.IMapSurround (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.createMapSurround(com.esri.arcgis.system.IUID, com.esri.arcgis.carto.IMapSurround), IMap.deleteMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.addMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.clearMapSurrounds()

clearMapSurrounds

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.createMapSurround(com.esri.arcgis.system.IUID, com.esri.arcgis.carto.IMapSurround), IMap.deleteMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.addMapSurround(com.esri.arcgis.carto.IMapSurround), IMap.clearMapSurrounds()

computeDistance

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

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).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
p1 - A reference to a com.esri.arcgis.geometry.IPoint (in)
p2 - A reference to a com.esri.arcgis.geometry.IPoint (in)
Returns:
The distance
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.getDistanceUnits(), IMap.getMapUnits()

getBasicGraphicsLayer

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.carto.IGraphicsLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.getActiveGraphicsLayer()

getActiveGraphicsLayer

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.carto.ILayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setActiveGraphicsLayerByRef

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
graphicsLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClipBorder

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

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.

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();     
  }   
}

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.carto.IBorder
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IMap.getClipGeometry()

setClipBorder

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
border - A reference to a com.esri.arcgis.carto.IBorder (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

selectFeature

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSelectionCount

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearSelection

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFeatureSelection

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.carto.ISelection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IViewManager.setElementSelectionByRef(com.esri.arcgis.carto.ISelection), IActiveView.getSelection()

setFeatureSelectionByRef

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
selection - A reference to a com.esri.arcgis.carto.ISelection (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

selectByShape

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

delayEvents

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
delay - The delay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPageSize

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

Remarks

SetPageSize sets 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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
widthInches - The widthInches (in)
heightInches - The heightInches (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPageSize

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getBarriers

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

Product Availability

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

Parameters:
pExtent - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Returns:
A reference to a com.esri.arcgis.carto.IBarrierCollection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUseSymbolLevels

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
flag - The flag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isUseSymbolLevels

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

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 .

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setExpanded

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
expanded - The expanded (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isExpanded

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The expanded
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAnnotationEngineByRef

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
annotateMap - A reference to a com.esri.arcgis.carto.IAnnotateMap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAnnotationEngine

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.carto.IAnnotateMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

recalcFullExtent

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

delayDrawing

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
delay - The delay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSpatialReferenceLocked

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
locked - The locked (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isSpatialReferenceLocked

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The locked
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.