Dynamic display compass


PurposeThis sample demonstrates drawing on the map in dynamic mode using an OpenGL application programming interface (API). A command is implemented that adds a compass object to the map, which rotates along together with the dynamic map.

The following issues are covered in this sample:
1. Wiring dynamic map events to listen to the Before or After DynamicDraw, which allows you to plug-in your drawing to the map.
2. Creation of OpenGL display lists.
3. Mapping a bitmap into an OpenGL texture and binding the texture to an OpenGL geometry.
4. Translating, scaling, and rotating OpenGL display lists.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Open the solution using Visual Studio 2005.
  2. Build the solution to make the Dynamic Display Compass command dll. You will need to use this command in an application with a MapControl and a ToolbarControl.
  3. Add the command to the ToolbarControl. The command can be found in the .NET Samples category with the name Dynamic Display Compass.
  4. Run the application and click the Dynamic Display Compass command to add the compass object to the map. The map switches into dynamic mode and adds the compass to the map. You will notice that the compass rotates with the map when rotated.

CompassCmd.cs Implementation file for the Dynamic Display Compass class
OpenGL_GL_v4.cs Wrapper class for OpenGL GL library
OpenGL_GLU_v4.cs Wrapper class for OpenGL GLU library
OpenGL_WGL_v4.cs Wrapper class for OpenGL WGL library
Download the C# files

Download the files for all languages

See Also:

About dynamic display
Dynamic Display - tracking dynamic object
Dynamic Display layer sample
Dynamic heads up display (HUD)