Layer actions operate on features contained in a tracking layer. Therefore, they can be applied to both real-time and fixed-time tracking layers. Layer actions are saved in a map document and configured through the Actions tab on the Layer Properties dialog box. If you save a tracking layer as a layer file in ArcMap or ArcGlobe, its action settings are saved along with the layer.
Unlike service actions, layer actions exist entirely in the client application, such as ArcMap. Therefore, these actions are typically related to data visualization for analysis. For example, you can highlight features on the map that meet a certain trigger condition.
The custom Visual Basic (VB) layer action is the most advanced layer action. It is a highly customizable action that can only be applied to real-time tracking layers. It is considered a layer action because it references a VB macro that is saved in a map document. It acts like a service action because it is applied to events as they stream in from a tracking service.
The complete set of layer actions available in Tracking Analyst is described below.
The Highlight/Suppress action changes the symbology of features that meet the trigger criteria that you define. The highlight action visually emphasizes events of interest by highlighting them using special symbology. You can choose the symbol to be used for the highlight, and it is placed behind the event's regular symbol when the map is drawn. The suppress action hides events that meet the trigger criteria by not drawing them on the map at all. When a highlight or suppress action is defined on a layer, it is immediately applied to all features meeting the trigger criteria in the layer.
The Filter layer action should not be confused with the Filter service action. The Filter layer action only allows you to specify events to be included in or excluded from further action processing. Tracking Analyst allows you to configure the order in which actions are processed, and understanding the ordering of actions is particularly important for this action. If there are no other layer actions defined after a filter action, the filter action will have no effect at all. If there are actions defined after the filter action, only events included in the filter (or not excluded from the filter) will be passed to the subsequent actions.
Custom VB action (only for real-time tracking layers)
The custom VB layer action provided by Tracking Analyst is available if you install and license the ArcGIS Desktop VBA Resources for Developers software that is included in your ArcGIS Desktop media package. Installation and licensing information is available in the ArcGIS Desktop Installation Guide. Once installed, refer to the ArcGIS Desktop VBA Resources for Developers help system for instructions on using the Visual Basic Editor to create macros for ArcGIS Desktop.
The custom VB layer action is different than the other layer actions because it can only be applied to real-time tracking layers. It is also different than service actions because it is defined for a tracking layer rather than a tracking service. VB actions are applied to real-time events as they are added to the tracking layer, but they are not applied to events already existing in the layer prior to triggering the action.
The Visual Basic action gives you great flexibility because a wide range of operations can be accomplished programmatically in a VB macro. VB macros can be written to accomplish a virtually unlimited number of things, such as displaying the attributes of new events as they are received, notifying an analyst with a pop-up message, or manipulating incoming data. Before defining a custom VB action for a layer, a VB macro must be written using the Visual Basic Editor. The VB macro is provided with an array containing the values from all the data fields for the incoming event.
To get you started, a couple of simple VB macros are provided below. It is important to note the specific structure of the first line of code in both cases. Follow this exact structure to receive incoming data values for the event in a single array of type variant. Then the individual data field values can easily be accessed in the body of the macro by referencing the array and setting the argument equal to the column number of the field. The ordering of the fields is the same as the order in which they appear in the attribute table for the tracking layer.
This macro displays the fifth field of an incoming data message on the ArcMap status bar. This macro will be run for all incoming events that meet the trigger criteria of the action.
Public Sub StatusBarMacro(ParamArray varArgs() As Variant) Application.StatusBar.Message(0) = varArgs(5) End Sub
This macro displays the third field of an incoming data message in a message box. This macro will be run for all incoming events that meet the trigger criteria of the action.
Public Sub MessageBoxMacro(ParamArray varArgs() As Variant) MsgBox varArgs(3) End Sub