Locate coordinates in a MapControl


PurposeThe Locate Coordinates sample is an application that shows you how to use the CoordinateTool object to determine decimal degree, DMS, UTM, and MGRS coordinates in a map control for a given location. The coordinates are generated from the MapControl's MouseDown event, and are displayed in text boxes in the form.

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. Run make command with the provided Makefile.
  2. Run the application.
  3. Click inside the MapControl and view the coordinates displayed in the dialog.

Additional information

A shapefile is loaded into the MapControl at runtime, and the path to the shapefile is hardcoded to the Samples\data folder. If this path does not work for some reason, change the path to the desired folder and rebuild the executable.

LocateCoords.cpp Implementation file
LocateCoords.h Header file
MapControlEvents.cpp Custom MapControl events
MapControlEvents.h Header file
Makefile.SolarisMotif Solaris Project Makefile
Makefile.LinuxMotif Linux Project Makefile
Download the Motif_CPP files
LocateCoords.cpp Implementation file
MapControlEvents.cpp Custom MapControl events
MapControlEvents.h Header file
Makefile.SolarisGTK Solaris Project Makefile
Makefile.LinuxGTK Linux Project Makefile
Download the GTK_CPP files
LocateCoordinates.cpp Implementation file
MapControlEvents.cpp Custom MapControl events
MapControlEvents.h Header file
Makefile.SolarisQT Solaris Project Makefile
Makefile.LinuxQT Linux Project Makefile
NMakefile.mak Windows Makefile
Download the QT_CPP files

Download the files for all languages




Additional Requirements
  • QT implementation requires QT4

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