How to use
See How to use ArcGIS samples for help on running the sample.
- To compile and run this application, use Ant or an integrated development environment (IDE), or execute its Java Archive (.jar) file.
- Open a .mxd file, such as mxds/usa.mxd, in the samples data directory (installDir/java/samples/data).
- Zoom in, zoom out, pan, and identify features.
Engine Viewer contains the following components:
- MapComponent—Provides basic map functionality such as zoom in, zoom out, pan, and identify.
- MapInfo—This class is used as a data handler for the application. It instantiates and maintains the current state of the map server. Any changes in the extent due to zoom in, zoom out, and so on, change the current extent of the map, resulting in MapInfo exporting an image. The image is then rendered on the MapComponent's display screen.
- Toolbar—Contains a set of tool buttons and a drop-down list of the maps that are contained in the .mxd file. Each tool button can be defined by providing the custom image and an action command. The available actions are as follows:
- Zoom in
- Zoom out
These actions are defined in the MapActions class. When a .mxd file is opened, the map list (combo box) is populated with the available maps, and the selections are set to the default map (focus map). A map selection from the drop-down appears in the MapComponent.
- TocControl—A tree-like structure that displays and changes the visibility of the layers. When a map is loaded, TocControl refreshes to display visibility of layers as defined in the .mxd file.
The following node types can be added to TocControl:
These nodes are extended from an abstract base class called Node. The MapFrame node displays the name of the map, and the layers in the map are added as Layer nodes. A check box is provided to toggle the visibility of the layers.
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.
|Development licensing||Deployment licensing|
|Engine Developer Kit||Engine|
|ArcGIS for Desktop Basic|
|ArcGIS for Desktop Standard|
|ArcGIS for Desktop Advanced|