MOLE symbols with interactive maps


PurposeThis sample Engine application demonstrates some of the ways that MOLE Basic symbols can be used to produce an interactive map display. The application provides a standard map / TOC / toolbar arrangement with an additional toolbar made using Qt widgets. The concepts demonstrated in this sample include:   Using the IMoleSymbol interface to customize MoleFillSymbol, MoleLineSymbol, and MoleMarkerSymbol objects.   Using the IMoleMarkerSymbol interface to customize a MoleMarkerSymbol.   How to use the TextLabels property of the IMoleSymbol interface to control a wide variety of labeling options.  Using PolygonElement, LineElement, and MarkerElement objects to organize and manipulate MOLE symbols in the active view’s graphics container.   How to select graphics on the map, move graphics on the map, and use display feedback to drag graphics on the map.

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. Compile the MoleSymbols project. At the command line, type MoleSymbols to launch the sample. The steps being taken to produce the display are printed on the console. The application uses a MapControl, TOCControl, and ToolbarControl. When the application first opens it attempts to load a map from the sample data.
  2. Click on the "Add MOLE Symbol" button, and then click on the map a few times. Each time you click, the symbol whose ID appears in the text box appears on the map. You can edit the symbol ID in the text box, or let it be replaced randomly each time you click. You can edit the size of the symbol in the numeric text box next to the symbol ID; this size is relative to the screen.
  3. Click the "Add a sample line graphic" button a few times. Each time you click, a random fix task line appears somewhere 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 appears somewhere in the current view extent.
  5. Click the "Select and drag graphics" button. Click on some graphics to select them, and drag on the graphics to move them. Click on an empty part of the map to clear the selection.
  6. Click on the "Move Units" button to move all units on the map ¾ degrees east and ¾ degrees north.
  7. Click on the "Create 200 graphics" button to add a bunch of force elements to the display.
  8. In order to use the GIS toolbar, neither the "Select and drag graphics" nor the "Add MOLE Symbol" button can be highlighted.
  9. In MoleSymbolsWindow::add200, 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.
  10. In MoleSymbolsWindow::addArea, uncomment the fill color and outline symbol settings to see more colorful and diverse areas.
  11. In MoleSymbolsWindow::addLine, uncomment the line color and width settings to see more color and diverse arrows.
  12. In MoleSymbolsWindow::moveUnits, experiment with different delta vectors, or add a state machine to make the symbols follow a path.
  13. In MoleSymbolsWindow::drawSymbol, uncomment the fill setting and see what force elements look like with no fill.
  14. In MoleSymbolsWindow::setLabels, comment and uncomment various combinations of property settings and observe the results.
  15. In MoleSymbolsWindow::selectElements, experiment with different search tolerances. Zoom into a region of the world and observe the selection behavior. Try computing a search tolerance relative to the current map extent.

MoleSymbols.cpp Implementation file
MoleSymbolsWindow.cpp Implementation file
Symbols.cpp Implementation file
MoleSymbols.h Header file
MoleSymbolsWindow.h Header file
Makefile Unix Makefile
NMakefile.mak Windows Makefile
Download the QT_CPP files

Download the files for all languages




Development licensing Deployment licensing
Engine Developer Kit: Military Overlay Editor Engine Runtime: Military Overlay Editor