- Use a feature layer when you want to display data from a feature service or from a mobile geodatabase via a feature table. A feature layer has an associated feature table that has a predefined schema that cannot be modified.
- Use a graphics overlay for more transient data, such as military messages coming through a web socket. A graphics overlay contains graphics, which have attributes you can set and modify.
For more information on whether to use feature layers or graphics overlays for your scenario, see Features and graphics.
When you display military symbols, you associate a dictionary symbol style (DictionarySymbolStyle) to a dictionary renderer (DictionaryRenderer), then associate the dictionary renderer to the layer or overlay where you want to display the symbols. The dictionary symbol style contains the symbols and the dictionary renderer displays them.
Display military symbols with a feature layer
The main steps you perform when displaying military symbols using a feature layer are to create a dictionary symbol style, associate it with a dictionary renderer, then apply that renderer to the feature layer. Each feature layer has an underlying feature table with individual feature records in it. Each feature in the table has a geometry field and one or more attribute fields that provide information that determines which symbol to use for that feature.
To display symbols
- Create a dictionary symbol style.
- Create a layer and set the feature table. Create a dictionary renderer by passing in the dictionary symbol style. If your data contains field names that don't match the fields in the military specification you're using, map the field names in your data to the specification fields. Then apply the renderer to the feature layer.
// create a new feature layer, pass the service feature table to the constructor FeatureLayer incidentsLayer = new FeatureLayer(incidentsFeatureTable); // create dictionary renderer and apply it to the layer DictionaryRenderer dictionaryRendrr = new DictionaryRenderer(symbolDictionary); incidentsLayer.Renderer = dictionaryRendrr;
Display military symbols with a graphics overlay
The main steps you perform when displaying military symbols using a graphics overlay are to create a dictionary symbol style, associate it with a dictionary renderer, then apply that renderer to the graphics overlay.
- Create a dictionary symbol style.
- Create a graphics overlay. Create a dictionary renderer by passing in the dictionary symbol style. If your data contains field names that don't match the fields in the military specification you're using, map the field names in your data to the specification fields. Then apply the renderer to the graphics overlay.
// create a graphics overlay GraphicsOverlay graphicsOverlay = new GraphicsOverlay(); // create a dictionary renderer and apply to overlay DictionaryRenderer dictRendrr = new DictionaryRenderer(symbolDictionary); graphicsOverlay.Renderer = dictRendrr;
Create a dictionary symbol style
To display military symbols, you associate the layer/overlay's dictionary renderer to a dictionary symbol style. A dictionary symbol style is composed of:
- A style file—A .stylx file you can create in ArcGIS Pro that contains symbol primitives such as the symbol frame, the lines that make up inner icons, and so on.
- A rule engine—A tool that assembles military symbols using data in the style file and rules from the military standard you specify.
The ArcGIS for Defense team hosts .stylx files on ArcGIS Online. These files contain the data that the dictionary renderer uses to display military standard symbology in custom native applications using the ArcGIS Runtime SDKs. See the Military Symbology Styles page for more information and to download the files.
To create a dictionary symbol style
- Specify the military specification you want to use.
- Specify the path to the .stylx file.
DictionarySymbolStyle symbolDictionary = await SymbolStyle.OpenAsync(styleXLocation) as DictionarySymbolStyle;
Map data fields to specification fields
The dictionary renderer will automatically read fields in your data that have names matching those required by the military specification. For any field names in your data that don't exactly match the field names provided in the military specification you want to use, map the field names by calling symbologyFieldOverides and textFieldOverrides on the dictionary renderer. These operations take in a set of key value pairs, where the key is the specification’s attribute name (for example, symbolset), and the value is your data's corresponding attribute name (for example, symbol_set).
If you're not sure if your fields match, you can obtain a string list of a given standard’s expected symbology and text fields by calling symbologyFieldNames and textFieldNames.
Military symbols are based on military specifications (military standards, such as MIL-STD-2525C and MIL-STD-2525D) and are made up of many elements such as frames, icons, modifiers, graphic amplifiers, and text amplifiers. In ArcGIS, military symbols are made up of multiple symbol layers.
Each military specification determines what values must be provided to assemble and render the symbol. In the case of MIL-STD-2525D, the symbols are based on a series of predefined attributes (such as identity, symbolset, and so on), each having a range of valid values associated with it. Other specifications may use only one attribute, but the one attribute value is made up of a code, such as a 15-character Symbol ID code (known as SIC or SIDC) that defines how the symbol should look. For example, in MIL-STD2525C, a SIC of GFGPOAP---****X represents this symbol . Regardless of the specification, all military symbols are based on a varying combination of attributes or codes and a set of rules about how the symbols should display.