This document is archived and information here might be outdated.  Recommended version.


IDynamicMapEvents Interface (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Display)  

IDynamicMapEvents Interface

Provides access to events that occur when the state of the dynamic display changes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Method AfterDynamicDraw Fired after the specified phase is drawn.
Method BeforeDynamicDraw Fired before the specified phase is drawn.
Method DynamicMapFinished Fired when the dynamic map finishes.
Method DynamicMapStarted Fired when the dynamic map starts.

CoClasses that implement IDynamicMapEvents

CoClasses and Classes Description
ControlsMapRoamTool (esriControls) Click the mouse left button to start or finish roaming, move the mouse to change roaming direction and speed.
DynamicMapEvents (esriCarto) Map events. Note: this class only provides access to the IDynamicMapEvents outbound interface.
Map (esriCarto) A container for the display and manipulation of map data.
TADynamicDisplayRefreshController (esriTrackingAnalyst) Manages all dynamic updates to all of ArcMap's maps, both in the map view and the page layout view.

Remarks

The Dynamic Map is an active Display, therefore the dynamic Map will get redrawn in events like - dirty dynamic layer, visible bounds change, refresh method call, new tile loaded, etc. In any of these cases, the BeforeDynamicDraw and AfterDynamicDraw events will get fired after all of the Layers (including Graphic Layers) will get drawn.

The difference between the BeforeDynamicDraw\AfterDynamicDraw and the DynamicMapStarted\DynamicMapFinished events, is that the BeforeDynamicDraw\AfterDynamicDraw Events will get fired only when the Display (Dynamic Map) needs to be redrawn, while the DynamicMapStarted\DynamicMapFinished events will get fired on every Dynamic Map heart beat (while the Dynamic Map is Enabled), even when the display is not redrawn.

The BeforeDynamicDraw\AfterDynamicDraw events are getting fired with two different phases (enum esriDynamicMapDrawPhase). Each phase has a different meaning and usage:

  1. esriDMDPDynamicLayers – This is getting fired on each dynamic cycle that the Dynamic Map re-renders the scene. The event is fired just before the first layer is rendered, and AfterDynamicDraw event is fired just after the last layer (including any Graphic Layer) is rendered.
    In this context, there is an active OpenGL Rendering context (with a preset rendering volume, viewport, etc).
    Use this context to plug-in any custom dynamic drawings with the DynamicDisplay API as well as with the OpenGL API. This context can be useful in order to draw dynamic elements behind or on top of the Layers and Graphics, which do not need to be associated with a layer.
  2. esriDMDPLayers – When the Dynamic Map is sensing that it needs to fetch tiles in order to be able to render the scene, the BeforeDynamicDraw will get fired. When the last missing tile is available and rendered the AfterDynamicDraw event will get fired.
    Note: It is not valid to use the DynamicDisplay API, nor the OpenGL API in this context, since the OpenGL Rendering Context is not fully setup.
    Use this context if you need to monitor when the Dynamic Map is still in a process of fetching tiles for rendering the display.