ArcGIS Engine (Controls / Symbology)  

Add Map Surrounds

Description

This sample demonstrates using the SymbologyControl 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.The sample uses the SymbologyControl in conjunction with the PageLayoutControl, TOCControl, ToolbarControl,and the controls commands.

Example Code

This example uses the following Java classes:

All code for this example may be copied in whole from <ArcGIS>/java/samples/engine/Controls.Symbology.AddMapSurrounds

Download

Download Sample here

Instructions

Follow these instructions to run the sample:

  1. Start the sample application.
  2. Load a mapdocument into the PageLayoutControl by clicking Open(The first button on the Toolbar).
  3. Click on the "Map Surrounds" toolbar menu.You can see NorthArrow,ScaleBar and ScaleText listed in there.
  4. Click on "NorthArrow" and drag a rectangle on the pagelayout frame.
  5. A Dialog box will open populated with all types of NorthArrow symbols.
  6. Click on any northarrow and when you click OK it will be added into the pagelayout.
  7. Repeat steps 4,5,6 to add "ScaleBar" and "ScaleText"on the pagelayout.

Files

Products

Engine

Platforms

Windows, Solaris, and Linux

Libraries

controls, carto, display, geometry, and systemUI

Classes

PageLayoutBean, ToolbarBean, HookHelper, NewEnvelopeFeedback, and MapSurroundFrame

Interfaces

IStyleGalleryItem, IGraphicsContainer, IMapFrame, IEnvelope, INewEnvelopeFeedback, IPoint, IElement, IMapSurround, and IMapSurroundFrame

Members

INewEnvelopeFeedback.moveTo, INewEnvelopeFeedback.start, INewEnvelopeFeedback.stop, HookHelper.setHookByRef, IGraphicsContainer.addElement, and MapSurroundFrame.setMapFrameByRef

Release

Since 9.2