Dynamic display—tracking dynamic object


Purpose
This sample shows how to use the ArcGIS dynamic display to track a dynamic object and simulate a tracking mode where the map is centered and aligned according to the tracked object. The following items are discussed in this sample:
  • Switching the display into dynamic mode
  • Updating the map visible extent and rotation according to information for the tracked object
  • Listening to the AfterDynamicDraw event to show the location of the tracked object
  • Creating dynamic glyphs from in-memory bitmaps
  • Changing different characters of the dynamic symbol
 
The tracking data for this sample gets created synthetically out of an existing feature class. This process might take time before the sample starts running.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and 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/USAMajorHighways/usa_major_highways.shp.
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. Start Visual Studio and open the solution file.
  2. Build the solution to make the Track Dynamic Object command .dll file. Use the command in an application with a MapControl and ToolbarControl, such as the MapControlApplication template included with the Visual Studio integration.
  3. Add this command to a ToolbarControl. The command (Track Dynamic Object) is located in the .NET samples category.
  4. Add the provided data to the MapControl. Make sure the file type is set to Shape files (*.shp).
  5. Run the application containing the MapControl and ToolbarControl, then zoom in an area on the roads. The application loads the navigation information from the target feature class and starts navigating (this procedure can take a few seconds).
  6. Click Track Dynamic Object to start tracking.

TrackObject.cs Implementation file of the command for tracking the dynamic object.
Download the C# files
TrackObject.vb Implementation file of the command for tracking the dynamic object.
Download the VB.NET files

Download the files for all languages

See Also:

Dynamic display
How dynamic display works
Best practices for using dynamic display
Walkthrough: Getting started with dynamic display
Sample: Dynamic display layer
Sample: Dynamic display compass
How to create a dynamic glyph from a marker symbol




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