Save MapDocument


Purpose
This sample demonstrates saving the contents of the PageLayoutControl to a map document (*.mxd). The PageLayoutControl is used in conjunction with the TOCControl, ToolbarControl and the Control Commands.

How to use

If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Run the application.
  2. Browse and select a MapDocument to load into the PageLayoutControl.
  3. Make changes to the PageLayout by toggling layer visibility and adding or repositioning graphic elements.
  4. Either save the changes to the original MapDocument, or save the changes into a new MapDocument.

Additional information

A browse dialog allows users to search and select map documents. The Open method of a new MapDocument object is passed the filename of the document selected in the browse dialog. The IPageLayoutControl::PageLayout property is set to the IMapDocument::PageLayout property. The TOCControl can be used to toggle layer visibility, and the graphic element tools on the ToolbarControl can be used to add and reposition elements in the PageLayout.
The changes made to the PageLayout can be saved to the existing MapDocument using the Save method, or the changes can be saved to a new MapDocument using the SaveAs method.


SaveMapDocument.h Main header file
SaveMapDocument.cpp Main implementation file
WidgetSetup.h Header file for creating the form
WidgetSetup.cpp Implementation file for creating the form
Makefile.SolarisMotif Solaris Project Makefile
Makefile.LinuxMotif Linux Project Makefile
Download the Motif_CPP files

Download the files for all languages




Development licensing Deployment licensing
Engine Developer Kit Engine