In this section:
By reviewing the ArcMap object model diagram, you can see that all the standard grid coclasses available in ArcGISCustomOverlayGrid, Graticule, IndexGrid, and MeasuredGridare subtypes of the MapGrid abstract class.
Looking at the MapGrid abstract class, you can see a custom map grid must implement IMapGrid. You also need to implement IClone and either IPersist and IPersistStream or IPersistVariant, (depending on your development environment), as grids must be clonable and persistable.
The existing map grids also implement IGraphicsComposite. This interface can be used programmatically to access the graphic elements that compose the displayed map grid. You will also implement IGraphicsComposite.
The MapGrid abstract class represents a grid of reference points or lines over
a Map.
Refer to this abstract class as the starting point for any custom map grid class.
Before you actually start coding your custom grid coclass, ask yourself if the functionality you require is similar to that available in any of the standard ArcGIS grid coclasses.
You may want to base your custom map grid on an existing map grid class by using containment.
IIndexGrid inherits from IMapGrid; therefore, you cannot implement this interface in VB. The VC++ implementation is described. VB programmers could create a basic map grid by implementing IMapGrid and adding their own custom implementation of index-type functionality including user interface.
The IIndexGrid and IGraphicsComposite interfaces cannot be implemented in VB.
Having reviewed the ArcMap object model and the map grid classes, you may have noticed that the existing map grids are all associated with a factory object.
For more information about MapGridFactories, see the section 'Plugging your custom grid into ArcMap'.
See Also Clippable Index Grid Example and Creating Cartography.