Dynamic display — tracking dynamic object


PurposeThis sample demonstrates using 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 sample covers the following issues:
1. Switching the display into dynamic mode
2. Updating the Map visible extent and rotation according to information of the tracked object
3. Implementing a dynamic layer to display the location of the tracked object
4. Creating dynamic glyphs out of a CharacterMarkerSymbol
5. Changing different characters of the dynamic symbol
6. Using a timer to regulate the update rate of the tracked object, including the usage of an Invoke helper to avoid making cross-apartment calls.

The tracking data for this sample gets created synthetically out of an existing FeatureClass. This process might take some time before that sample starts running.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime

Additional Requirements
  • This sample uses the following dataset: <your ArcGIS install location>/DeveloperKit/SamplesNET/Data/USMajorHighways/usa_major_highways.shp

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.
  2. Build the solution to make the Track Dynamic Object command dll.
  3. You will need to use the command in an application with a MapControl and ToolbarControl.
  4. Add this command to a ToolbarControl. The command can be found in the .NET Samples category with the name Track Dynamic Object.
  5. Add the data to the MapControl. The data can be found at <Your install location>/DeveloperKit/SamplesNET/Data/USMajorHighways/usa_major_highways.shp. Hint: If you are not seeing it in the Browse dialog box for the Add Data button, make sure you have Files of type set to Shape files (*.shp).
  6. Run the application containing the MapControl and Toolbar control and zoom in on an area on the roads. The application will load the navigation information from the target FeatureClass (which may take some time) and will start navigating.
  7. Click Track Dynamic Object to start tracking.

TrackObject.cs Implementation file of the command for tracking the dynamic object
ObjectLocationClass.cs Implementation file of the custom layer used to draw the location of the dynamic object
CustomLayerBase.cs The custom layer base class that implements the layer's essential interfaces
Download the C# files
TrackObject.vb Implementation file of the command for tracking the dynamic object
ObjectLocationClass.vb Implementation file of the custom layer used to draw the location of the dynamic object
CustomLayerBase.vb The custom layer base class that implements the layer's essential interfaces
Download the VB.NET files

Download the files for all languages

See Also:

About dynamic display
Dynamic Display layer sample
Dynamic Display—compass
How to create a dynamic glyph from a marker symbol
Writing multithreaded ArcObjects code