Using MOLE symbol-based graphics with interactive maps


Purpose
This Engine application demonstrates some of the ways that Military Overlay Editor (MOLE) symbol-based graphics can be used to produce a simple interactive map display. The application provides a standard MapControl/TOCControl/ToolbarControl arrangement with an additional toolbar made using .NET controls. The concepts demonstrated in this sample include the following:
  • Using the IMoleSymbol interface to customize MoleFillSymbol, MoleLineSymbol, and MoleMarkerSymbol objects
  • Using the IMoleMarkerSymbol interface to customize a MoleMarkerSymbol
  • Using the TextLabels property of the IMoleSymbol interface to control a wide variety of labeling options
  • Using the PolygonElement, LineElement, and MarkerElement objects to organize and manipulate MOLE symbols in the active view’s graphics container
  • Selecting and moving graphics on the map and using display feedback to drag graphics on the map

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/MilitaryOverlayEditor/molebasemap.mxd.
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.

Running and using the sample
  1. Build the MoleSymbols solution and run MoleSymbols.exe. The application uses a MapControl, TOCControl, ToolbarControl, and LicenseControl.
  2. Click the Add MOLE Symbol button, then click the map a few times. Each time you click, the graphic whose ID appears in the Symbol ID code box appears on the map (see the following screen shot). You can edit the Symbol ID code in the box or let it be replaced randomly each time you click. You can change the size of the graphic by changing the value in the Symbol size box (the size is relative to the screen). Note: The GIS toolbar is disabled while the Add MOLE Symbol button is active (highlighted). When you're finished using the tool, click its button again to deactivate it and enable the GIS toolbar.
  3. Click the Add a Sample Line Graphic button a few times. Each time you click, a random fix task line appears in the current view extent.
  4. Click the Add a Sample Area Graphic button a few times. Each time you click, a random obstacle restricted area graphic appears in the current view extent.
  5. Click the Select and Drag Graphics button, click a graphic to select it (a selection frame appears around the graphic), and drag the graphic to move it. Click an empty part of the map to clear the selection. Note: The GIS toolbar is disabled while the Select and Drag Graphics button is active (highlighted). When you're finished using the tool, click its button again to deactivate it and enable the GIS toolbar.
  6. Click the Move Units button to move all graphics on the map ¾ degrees east and ¾ degrees north.
  7. Click the Add a Bunch of Graphics button to add several force element graphics to the map.


  8. MOLE Symbols toolbar, force element graphic, and selection frame

Modifying the sample
  1. In function/method tsbAdd200_Click, you can alter the number of graphics by changing the for loop’s limit. You can also change the radius ratio and the number of force elements in each circular arrangement.
  2. In tsbAddArea_Click(), uncomment the fill color and outline symbol settings to see more colorful and diverse areas.
  3. In tsbAddLine_Click(), uncomment the line color and width settings to see more colorful and diverse arrows.
  4. In tsbMoveUnits_Click(), experiment with different delta vectors or add a state machine to make the symbols follow a path.
  5. In DrawSymbol(), uncomment the fill setting and see what force elements look like with no fill.
  6. In GetLabels(), comment and uncomment various combinations of property settings and observe the results.
  7. In SelectElements(), experiment with different search tolerances. Zoom into a region of the world and observe the selection behavior. Compute a search tolerance relative to the current map extent.

Additional information

Many of the ArcGIS Military Analyst and MOLE extension application programming interface (API) objects you have used in the past have equivalent or near equivalent objects in the ArcGIS 10 ArcObjects API. These new objects should now be used and do not require a Military Analyst extension or MOLE extension license. See Migrating from Military Analyst and MOLE for information on how to accomplish tasks in ArcGIS 10 that previously required the Military Analyst and MOLE APIs.

MainForm.vb Main form of the application.
MainForm.Designer.vb Main form of the application.
MainForm.resx Resources for the application.
DemoSIC.vb Test Symbol ID generator.
Program.vb Entry point for the application.
Download the VB.NET files
MainForm.cs Main form of the application.
MainForm.Designer.cs Main form of the application.
MainForm.resx Resources for the application.
DemoSIC.cs Test Symbol ID generator.
Program.cs Entry point for the application.
Download the C# files

Download the files for all languages

See Also:

DefenseSolutions library overview - Managing MOLE Graphics as Standard ArcObjects
Using military symbology and symbol-based graphics
Sample: Displaying symbol-based MOLE graphics on a MapControl
Sample: Decluttering MOLE graphics using leadering and stacking
Sample: Arranging MOLE graphics using manual decluttering




Development licensing Deployment licensing
Engine Developer Kit: Military Overlay Editor Engine Runtime: Military Overlay Editor
ArcView: Military Overlay Editor
ArcEditor: Military Overlay Editor
ArcInfo: Military Overlay Editor