Draw graphic elements on map


Purpose
This sample demonstrates how to create a toolbar palette of drawing tools and graphic elements on a map. The palette is accessed from the ToolbarBean or by right-clicking the PageLayoutBean.
 
The addItem method is used in setBuddyControlAndTools to add new items to the ToolbarBean with their style set. In the PageLayoutBean OnMouseDown event, the popupPalette method is used to display the ToolbarPalette when the right mouse button is pressed.

How to use

See How to use ArcGIS samples for help on running the sample. 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 DrawGraphicElementsOnMap application.
  2. Click the palette, select a graphic element, and draw it on the map by clicking and dragging the mouse.


Download the files for Java
toolbarbean/DrawGraphicElementsOnMap.java Main class




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo