Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows retrieving and manipulating modifiers of a military symbol, without having to worry whether the properties are encoded in the symbol code or in textual modifiers.

The modifiers of a military symbol are partly encoded in its symbol code (e.g. the MIL-STD 2525b symbology encodes the affiliation in the second digit of the symbol code) and partly encoded as additional metadata called text modifiers (usually a key-value map). This class exposes all these modifiers as enumerable, modifiable JavaScript properties.

It does not represent a Feature or domain object, and does not cover the geometry. To generate a Shape that corresponds to a military symbol, please use the SymbologyNode.createTemplates method.

Example usages

Query and configure a symbol

  // 1) create a MIL-STD 2525b "rescue" symbol based on the code from the specification or a SymbologyNode
  var codedRescueSymbol = new MilitarySymbol(MIL_STD_2525b, "G*G*GPAR--****X");
  // codedRescueSymbol has properties for all applicable code and text modifiers.
  // Mask characters have been replaced from the symbol code. Hence, the following statement is true:
  // codedRescueSymbol.code === "GUG-GPAR------X"

  // 2) query the available modifiers
  console.log("available modifiers:");
  for (var modifier in codedRescueSymbol) {
    if (codedRescueSymbol.hasOwnProperty(modifier) ) {
      console.log(modifier); // this outputs, among others, "affiliation" and "additionalInformation"
    }
  }

  // 3) query the possible values of the "affiliation" modifier
  codedRescueSymbol.possibleValues("affiliation"); // returns an array containing, among others, the value "Friend"

  // 4) change the "affiliation" modifier.
  codedRescueSymbol.affiliation = "Friend";
  // The properties of a MilitarySymbol object are read-write and immediately update the values for the code and
  // text modifiers. The "affiliation" modifier is encoded in the symbol code, so the following statement is true:
  // codedRescueSymbol.code === "GFG-GPAR------X"

  // 5) change the "additionalInformation" modifier.
  codedRescueSymbol.additionalInformation = "this is an example symbol"; // adds a new entry to codedRescueSymbol.textModifiers
  // the "additional information" modifier is encoded as a text modifier

  // 6) create a domain object with the encoded modifiers
  var rescueDomainObject = new Feature(
    myRescueGeometry,
    {
     code : codedRescueSymbol.code, // "GFG-GPAR------X"
     textModifiers : codedRescueSymbol.textModifiers
    },
    1
  );

Change a modifier of an existing object

  // Change the value for the status modifier of an existing object
  var codedExistingSymbol = new MilitarySymbol(MIL_STD_2525b, existingDomainObject.code, existingDomainObject.textModifiers);
  codedExistingSymbol.status = "present";
  existingDomainObject.code = codedExistingSymbol.code;
  existingDomainObject.textModifiers = codedExistingSymbol.textModifiers;

Available modifiers

Depending on the used symbol, the following modifiers are exposed as a property of the MilitarySymbol object:

APP-6

Encoded in its symbol code
  • status
  • affiliation (APP-6A/B)
  • standardIdentity1 (APP-6C)
  • standardIdentity2 (APP-6C)
  • sector1 (APP-6C)
  • sector2 (APP-6C)
  • orderOfBattle (APP-6A/B)
  • country (APP-6A/B)
  • echelon
Encoded as text modifiers
  • uniqueDesignation
  • higherFormation
  • dateTimeGroup
  • staffComments
  • additionalInformation
  • quantityOfEquipment
  • reinforcedOrReduced
  • evaluationRating
  • combatEffectiveness
  • signatureEquipment
  • iFFSIF
  • movementDirection
  • typeOfEquipment
  • altitudeDepth
  • speedLabel
  • effectiveTime
  • locationLabel
  • hostile (APP-6C)
  • trackNumber (APP-6C)
  • name (APP-6C)
  • commonIdentifier (APP-6C)
  • country (APP-6C)
  • capacity (APP-6C)
  • positionAndMovement (APP-6C)
  • platformType (APP-6C)
  • namedHeadquarters (APP-6C)
  • teardownTime (APP-6C)
  • headquartersElement (APP-6C)
  • installationComposition (APP-6C)
  • length
  • width
  • attitude

MIL-STD 2525

Encoded in its symbol code
  • status
  • affiliation
  • orderOfBattle
  • country
  • echelon
Encoded as text modifiers
  • uniqueDesignation
  • higherFormation
  • dateTimeGroup
  • staffComments
  • additionalInformation
  • quantity
  • reinforcedOrReduced
  • evaluationRating
  • combatEffectiveness
  • signatureEquipment
  • iFFSIF
  • movementDirection
  • typeLabel
  • altitudeDepth
  • speedLabel
  • effectiveTime
  • locationLabel
  • hostile
  • length
  • width
  • attitude

Hierarchy

  • MilitarySymbol

Overview

Constructors

constructor

  • Creates a new coded military symbol with the given code and text properties. All applicable modifiers will be exposed as modifiable properties of the MilitarySymbol. The code is a read-only property. The type of the MilitarySymbol cannot be changed anymore, but you can create a clone with a different type by calling the copyAndChangeCode method.

    Parameters

    • symbology: HierarchicalSymbology

      The symbology the symbol belongs to.

    • code: string

      The (configured) symbol code. Can already contain modified code modifiers.

    • Optional textModifiers: any

      Any (optional) modifiers. Object literal mapping the text modifier name to the value.

    Returns MilitarySymbol

Accessors

code

  • get code(): string
  • The configured symbol code.

    Returns string

textModifiers

  • get textModifiers(): object
  • Returns a map linking the text modifier names to the text modifier values.

    Returns object

Methods

copyAndChangeCode

  • Creates a new military symbol based on the given code. Modifiers of the current symbol are retained if they are still applicable and not overridden by the given code.

    For example, applying this function to an existing MIL_STD_2525b space track with code
    "SUPP------HDBEX"
    by passing the code
    "SFA------****"
    will return a new MIL_STD_2525b air track with code
    "SFAP------HDBEX".

    Parameters

    • code: string

      representing the new symbol type

    Returns MilitarySymbol

    a new military symbol of the given type, with the same modifiers as the current symbol (if not overridden)

possibleValues

  • (modifier: string): string[] | null
  • Returns the possible values for a given modifier, or null if the possible values cannot be enumerated. As an example, the possible values for the modifier "affiliation" could be "Neutral" and "Friendly".

    Parameters

    • modifier: string

      the modifier for which to return the possible values. One of the properties defined in this symbol.

    Returns string[] | null

    the possible values for the given modifier

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method