@orbat-mapper/control-measures
v0.2.0-alpha.15
Published
Library for drawing tactical graphics and control measures according to MIL-STD-2525 and APP-6 standards.
Maintainers
Readme
@orbat-mapper/control-measures
Generates tactical control measures as GeoJSON, following MIL-STD-2525 and APP-6 conventions.
The output is plain GeoJSON, so it drops into Leaflet, MapLibre, OpenLayers,
or any other consumer without a mapping dependency of its own. Everything
goes through one entry point, renderControlMeasure(cm, options), backed by
a metadata catalog for discovering the available measures and their options,
plus an optional validationMode per render for catching bad input.
Installation
# npm
npm install @orbat-mapper/control-measures
# pnpm
pnpm add @orbat-mapper/control-measuresQuick Start
Describe a control measure as a ControlMeasure object — kind,
controlPoints, and optional options — then render it:
import { renderControlMeasure, type ControlMeasure } from "@orbat-mapper/control-measures";
const mainAttack: ControlMeasure<"main-attack"> = {
id: "alpha",
kind: "main-attack",
controlPoints: [
[10, 10], // tip
[5, 5], // spine
[0, 0], // neck
[2, 6], // width control
],
};
const render = renderControlMeasure(mainAttack, { validationMode: "warn" });
// render is a ControlMeasureRender: a GeoJSON FeatureCollection whose features
// carry stable ids (`${cm.id}:${part}:${index}`) and resolved style hints.renderControlMeasure returns a ControlMeasureRender — a GeoJSON
FeatureCollection of FeaturePartProps-typed features.
Discovering measures and options
Skip the per-measure imports and query the catalog instead:
import {
CONTROL_MEASURE_IDS,
listControlMeasureMetadata,
getControlMeasureMetadata,
getDefaultOptions,
} from "@orbat-mapper/control-measures";
CONTROL_MEASURE_IDS; // readonly list of every control-measure id
listControlMeasureMetadata(); // metadata (geometry, required points, params, symbology)
getControlMeasureMetadata("block"); // metadata for one measure
getDefaultOptions("block"); // default options object for one measureEach measure also exports its options type and defaults constant, e.g.
BlockOptions / DEFAULT_BLOCK_OPTIONS, MainAttackOptions /
DEFAULT_MAIN_ATTACK_OPTIONS.
Validation behavior
renderControlMeasure accepts a RenderOptions object whose validationMode
controls how invalid coordinate input is handled:
validationMode: "silent" | "warn" | "throw"
When omitted, validation defaults to silent mode — invalid input yields an
empty render. "throw" is useful for strict integrations and tests.
Supported control measures
Grouped by APP-6/MIL-STD-2525 entity type, with each measure's 2525E symbol code.
Command and Control Lines
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | boundary | Boundary | 110100 |
Maneuver Lines
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | flot | Forward line of own troops (FLOT) | 140100 |
| | final-protective-fire-left | Final Protective Fire (Left) | 140501 |
| | final-protective-fire-right | Final Protective Fire (Right) | 140502 |
| | principal-direction-of-fire | Principal Direction of Fire | 140503 |
| | ambush | Ambush | 141700 |
Maneuver Areas
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | fortified-area | Fortified Area | 151000 |
| | battle-position | Battle Position | 151200 |
| | strong-point | Strong Point | 151203 |
| | airborne-attack | Airborne Attack | 151401 |
| | attack-helicopter | Attack Helicopter | 151402 |
| | main-attack | Main Attack | 151403 |
| | supporting-attack | Supporting Attack | 151404 |
| | encirclement | Encirclement | 151800 |
| | attack-by-fire | Attack by Fire | 152000 |
| | support-by-fire | Support By Fire | 152100 |
| | search-area | Search Area | 152200 |
Protection Areas
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | block | Block | 270501 |
| | disrupt | Disrupt | 270502 |
| | fix | Fix | 270503 |
| | turn | Turn | 270504 |
| | obstacle-bypass-easy | Obstacle Bypass Easy | 270601 |
| | obstacle-bypass-difficult | Obstacle Bypass Difficult | 270602 |
| | obstacle-bypass-impossible | Obstacle Bypass Impossible | 270603 |
Protection Lines
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | antitank-ditch-under-construction | Ditch - Under Construction | 290201 |
| | antitank-ditch-completed | Ditch - Completed | 290202 |
| | antitank-wall | Antitank Wall | 290204 |
| | fortified-line | Fortified Line | 290900 |
Mission Tasks
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | block-mission-task | Block | 340100 |
| | breach | Breach | 340200 |
| | bypass | Bypass | 340300 |
| | canalize | Canalize | 340400 |
| | clear | Clear | 340500 |
| | delay | Delay | 340800 |
| | isolate | Isolate | 341500 |
Generic Graphics
| Preview | kind | Measure | 2525E Value |
| --- | --- | --- | --- |
| | block-arrow | Block Arrow | 990001 |
| | classic-arrow | Classic Arrow | 990002 |
| | line | Line | 990101 |
| | polygon | Polygon | 990102 |
| | rectangle | Rectangle | 990103 |
| | circle | Circle | 990104 |
This table and the preview SVGs are generated; run
pnpm --filter @orbat-mapper/control-measures generate-docs after adding or
changing a measure to refresh both.
License
MIT
