Dynamic Display layer sample


PurposeThis sample demonstrates using the ArcGIS Dynamic Display to implement a dynamic layer. A dynamic layer is a custom layer that, in addition to the standard interfaces, implements the IDynamicLayer interface. That interface allows this layer to draw its items into the Dynamic Disiplay and take advantage of graphics card hardware acceleration.

This layer uses synthetic data to simulate dynamic data. In case of a real-life dynamic layer, the dynamic data might be streamed to the layer by a communication port, Extensible Markup Language (XML) stream, ArcGIS tracking server, or any other live feed.

This sample features a new abstract BaseClass, which simplifies the creation of dynamic layers. To implement a dynamic layer with the new BaseClass, the user only has to inherit the BaseClass and override the abstract method DrawDynamicLayer(). The BaseClass offers default implementation for all other methods and properties. Of course, the user can also override any of these methods since they are set as virtual.

Development licensing Deployment licensing
Engine Developer Kit Engine Runtime

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 'Add DynamicLayer' command dll.
  3. You will need to use this command in an application with a MapControl and a ToolbarControl.
  4. Add the command to the ToolbarControl. The command can be found in the 'My DynamicLayer' category with the name 'Add DynamicLayer'.
  5. Run the application and add any layer to use as a background.
  6. Click the 'Add DynamicLayer' command in order to add the dynamic layer to the map. You will notice that the map will switch into Dynamic-Mode and the layer with 100 dynamic items will get added to the map.

CustomLayerBase.cs DynamicLayerBase class, serves as a BaseClass for dynamic layers
MyDynamicLayerClass.cs Implementation file of the dynamic layer
AddMyDynamicLayerCmd.cs A command that allows to add or remove the dynamic layer
DynamicLayerToolbar.cs The toolbar that hosts the AddMyDynamicLayer command
Download the C# files
CustomLayerBase.vb DynamicLayerBase class, serves as a BaseClass for dynamic layers
MyDynamicLayerClass.vb Implementation file of the dynamic layer
AddMyDynamicLayerCmd.vb A command that allows to add or remove the dynamic layer
DynamicLayerToolbar.vb The toolbar that hosts the AddMyDynamicLayer command
Download the VB.NET files

Download the files for all languages

See Also:

About dynamic display
Dynamic-Display - tracking dynamic object
Dynamic Display - Compass
Writing Multithreaded ArcObjects Code
How to create a Dynamic Glyph from a marker symbol
Dynamic Logo layer
Dynamic heads up display (HUD)