DS Map Book


This Developer Sample code is designed to allow for the creation of Map Books. A page is create in the book based on each feature in a grid/index layer specified by the user. Index layers must contain polygon features with a string field containing the name of each tile/page. The features in the index layer do not have to be of any particular size or shape, nor do they need to be continuous or non-overlapping. Several commands are included for generating index layers based on a uniform grid or based on selected, continuous line features.

Using the index layer, pages are generated for the book. These pages are persisted within the map document and can be printed or exported at any time.

For more specific information on using the sample, please see the Map Book Generation.doc file included with the code.

Options on the toolbar include:

  • Create Map Book - Generate a new Map Series based on your index layer.
  • Add Identifier Frame - Add Local or Global Indicator frames to show the position of the page/tile in reference to the other tiles.
  • Create/Update Map Grids - Generate or Update index layers based on a uniformed grid.
  • Create Stripmap Grids - Generate an index layer based on a continuous set of selected line features.
  • There are two Visual Basic projects included with the code. The first project (DSMapBookPrj.vbp) includes the code for the MapBook, MapSeries, and MapPage objects used within the second project (DSMapBookUIPrj.vbp). The Map Book application is an extension to ArcMap and the MapBook, MapSeries, and MapPage objects can be obtained from the extension. This makes it possible to write additional code through VBA or some other method for manipulating the objects. See the Map Book Generation.doc file for more information.

    In the code section below, the first 8 items are from the DsMapBookPrj project, while the remaining items are from the DSMapBookUIPrj.

    How to use:
    1. Double click on the _Install.bat file include with the code. This batch file will register two dlls and put all the included classes in the correct categories. The classes include one extension, one Contents View (Tab), one toolbar, and four commands/Tools. The install and uninstall batch files assume the regsvr32 command is accessible from the system path.
    2. Add layers to your map session. One of the layers must be an index layer that already exists, or you create with the Create/Update Map Grids or Create StripMap Grids commands.
    3. Open the Map Book Generation.doc file included with the code and follow the procedures to create and output a map book.

    Requires: Index layer and other data

    Difficulty: Advanced

    Visual Basic
    File Description
    DSMapBook.cls Map Book object used to hold the Map Series objects.
    DSMapPage.cls Map Page object holding specifc information about the pages in the book.
    DSMapSeries.cls Map Series object holding specific information about the series with the book and the pages.
    IDSMapBook.cls Map Book interface implemented by the Map Book object.
    IDSMapPage.cls Map Page interface implemented by the Map Page object.
    IDSMapSeries.cls General Map Series inteface implemented by the Map Series object.
    IDSMapSeriesOptions.cls Interface implemented by Map Series object. Contains series options.
    IDSMapSeriesProps.cls Interface implemented by Map Series Object. Contains general series properties.
    frmExport.frm Form for exporting pages to a file of the chosen format.
    frmGridSettings.frm Form for creating/updating an index layer.
    frmMapSeries.frm Form containing the tree view for the TOC tab and the events on that object.
    frmMapSeriesWiz.frm Form for generating a Map Series based on user settings.
    frmPageIdentifier Form for specifying the type of page identifier to add.
    frmPageProperties.frm Form for displaying and updating the page properties.
    frmPrint.frm Form for specifying the output device when printing pages.
    frmProgress.frm Form containing the progess bar for the index layer generation commands.
    frmResources Form containing the icons for 4 tools on the toolbar.
    frmSelectPages.frm Form for selecting pages to output.
    frmSeriesProperties.frm Form for displaying and updating the properties of the series.
    frmSMapSettings.frm Form for generating an index layer based on a selected line features.
    modGeneralFunctions.bas Basic module containing routines used throughout the project.
    modGlobals.bas Basic module for dimensioning global variabiles and defining WinAPI routines.
    clsCreateGrids.cls Class for generating new uniformed index layers.
    clsCreateStripMap.cls Class for generating a new index layer based on select line features.
    clsMapGridButton.cls Class containing the implementation of ICommand for the generation of index layers.
    clsStripMapbutton.cls Class containing the implementation of ICommand for generating an index layer from selected line features.
    CreateMapBook.cls Class for creating a new map series.
    DSMapBookBar.cls Class for the Map Book toolbar.
    DSMapBookExt.cls Class for the Map Book extension.
    DSMapBookTab.cls Class for the Map Book Contents View (Tab).
    GxFilter.cls Class for browsing for index layers to create/update.
    PageIdentifier.cls Class for creating local or global indicator frames on the layout.
    tmpPageClass.cls Class for holding page properties during the creation of a new series.

    Key CoClasses: Map, MapFrame, PageLayout
    Key Interfaces: IActiveView, IElementProperties, IExporter, IGraphicsContainer, IMap, IMapFrame
    Key Members: IActiveView::Output, IElementProperties::Name, IExporter::Resolution, IGraphicsContainer::DeleteElement, IGraphicsContainer::Next, IMap::ClipGeometry, IMapFrame::Map