Move a graphic along a path in ArcMap


PurposeThis sample implements the move-object-along-path functionality for ArcMap animation. It allows you to move a point graphic element or a text element along a selected line feature or a selected line graphic. A new animation type (Map Graphic animation type) and its corresponding keyframe (Map Graphic keyframe) are implemented to support moving a graphic along the path. It also implements an ArcMap command for creating a move-object-along-path animation. The purpose of this sample is to show how to create a custom animation type in ArcMap and how to implement an ArcMap command to import the animation tracks. To create a custom animation type, implement a new keyframe class and a new animation type class.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. 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.

Add and use the move-graphic-along-path functionality in ArcMap
  1. Compile the sample project in Visual Studio.
  2. Start ArcMap and click Customize, Toolbars, and Animation. The Animation toolbar appears.
  3. Click Customize, then Customize Mode. The Customize dialog box appears.
  4. On the Commands tab, locate the Animation Developer Samples category.
  5. Drag the Move Graphic along Path command from the Animation Developer Samples category to the Animation drop-down on the Animation toolbar. Close the Customize dialog box.
  6. Add a line feature layer on to the table of contents (TOC) in ArcMap; or alternatively, draw a line graphic element on the ArcMap display.
  7. Draw a point graphic element (or a text element) on the display and symbolize it as necessary.
  8. Select the point graphic element (or the text element) and a line feature (or line graphic). The Move Graphic along Path command is enabled.
  9. On the Animation drop-down, click the Move Graphic along Path command.
  10. Accept all default settings and click the Import button on the Move Graphic along Path dialog box to create a track.
  11. Play the animation and the point graphic element (or text element) moves along the selected path.

Additional information

  1. If more then one line feature (or line graphic) is selected, only the first one is used as the path of the movement.
  2. You can elect to show the trace of the moving graphic element by selecting the Trace path option on the Move Graphic along Path dialog box when you create the track. 
  3. You can change the Trace path option after a track is created by opening the Animation Manager and selecting the track on the Tracks tab. Click Properties, then click the Graphic Track Properties tab. The Trace path option is available on this tab.
  4. You can change the symbology for the point graphic element (or text element) and the line graphic representing the trace on the ArcMap display window.


AnimationTypeMapGraphic.cs The map graphic animation type class.
MapGraphicKeyframe.cs The map graphic keyframe class.
cmdMoveGraphicAlongPath.cs Command for creating move-graphic-along-path animation.
frmCreateGraphicTrackOptions.cs Dialog box to get the parameters for creating move-graphic-along-path animation.
MapGraphicTrackPropPage.cs Map graphic track property page.
AnimationUtils.cs Utility code for creating a move-graphic-along-path animation.
MapGraphicTrackExtension.cs The Map graphic track extension class.
Download the C# files
AnimationTypeMapGraphic.vb The map graphic animation type class.
MapGraphicKeyframe.vb The map graphic keyframe class.
cmdMoveGraphicAlongPath.vb Command for creating move-graphic-along-path animation.
frmCreateGraphicTrackOptions.vb Dialog box to get the parameters for creating move-graphic-along-path animation.
MapGraphicTrackPropPage.vb Map graphic track property page.
AnimationUtils.vb Utility code for creating a move-graphic-along-path animation.
MapGraphicTrackExtension.vb The Map graphic track extension class.
Download the VB.NET files

Download the files for all languages




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced