Add map surrounds


Purpose
This sample demonstrates how to use the Symbology control to display north arrow, scale bar, and scale text symbols, which are used by custom commands when adding MapSurround objects to the GraphicsContainer of the PageLayout. This sample uses the Symbology control in conjunction with the PageLayout control, TOC control, Toolbar control, and the controls commands.

How to use

See How to use ArcGIS samples for help on running the sample.

  1. Start the sample application.
  2. Click Open to load a map document into the PageLayout control.
  3. Click the Map Surrounds toolbar menu. NorthArrow, ScaleBar and ScaleText are listed.
  4. Click NorthArrow and drag a rectangle on the page layout frame. A dialog box populated with various types of north arrow symbols opens.
  5. Click a north arrow and click OK. The north arrow is added to the page layout.
  6. Repeat steps 3, 4, and 5 using ScaleBar and ScaleText to add a scale bar and scale text to the page layout.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

symbologybean/AddMapSurrounds.java Loads a frame with Map, TOC, and Toolbar controls, and a toolbar menu with different map surrounds as menu items.
symbologybean/tools/NorthArrowTool.java Creates a custom tool to handle various mouse events and calls SymbologyFrame when NorthArrow is clicked.
symbologybean/tools/CreateScaleBarTool.java Creates a custom tool to handle various mouse events and calls SymbologyFrame when ScaleBar is clicked.
symbologybean/tools/CreateScaleTextTool.java Creates a custom tool to handle various mouse events and calls SymbologyFrame when ScaleText is clicked.
symbologybean/ui/SymbologyFrame.java Opens a dialog box with north arrow, scale bar, or scale text symbols (depending on the item clicked on the toolbar menu).




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced