Locate Coordinates Map control


Purpose
This sample shows how to use the CoordinateTool class to determine decimal degree; degrees, minutes, and seconds (DMS); universal transverse Mercator (UTM); and Military Grid Reference System (MGRS) coordinates in a Map control for a given location. The coordinates are generated from the MapControl MouseDown event and are displayed in text boxes in the form.
 
A shapefile is loaded into the Map control at run time, and the path to the shapefile is hardcoded to the Samples\data folder. If this path does not work for any reason, change the path to the desired folder and rebuild the executable.

How to use

See How to use ArcGIS samples for help on 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/world/Continent.lyr.
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 application.
  2. Click the Map control. The corresponding coordinates are displayed.

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.


Download the files for Java
defensesolutions/CoordinateToolMapControl.java Contains the main class implementation.




Development licensing Deployment licensing
Engine Developer Kit: Military Analyst Engine Runtime: Military Analyst