Battle maps

A battle is easiest to follow when you can watch it. A battle map shows forces the way a staff map does: a symbol for each unit that moves along the route it took, arrows that draw on as an attack goes in, and the ground each side held changing from day to day. Scrub the time slider to move through it, or play a tour that stops at each turning point and runs the clock on to the next.

It works for historical battles, exercises and games, and for anything else that moves in a way a symbol can show: a convoy, a fleet, a relief operation. For things that are not military at all (a ferry, a flight, a delivery van, a collared animal, a storm) the same tools go by an everyday name: see Not only battles.

What you need

Three kinds of data, all optional except the first:

  • Units. A table with one row for each place a unit is known to have been, and when. Sarkoa joins a unit's rows into one track.
  • Fronts. Polygons for the ground one side held, each valid for a date range.
  • Axes and events. Lines for attacks and withdrawals, and points for the moments worth stopping on.

You keep these as CSV files. A command turns them into the files Sarkoa draws.

The units table

One row for each position. Rows of the same unit share a unit_id.

Column Meaning
unit_id, name A short id and the unit's name.
side Any word you like (allied, axis, red). You say which is friendly and which is hostile when you build.
kind infantry, mechanized, armour, cavalry, artillery, airborne, antitank, engineer, headquarters; in the air air, bomber, fighter or patrol; at sea naval, carrier, battleship, cruiser, destroyer, transport or submarine; or unknown.
echelon Optional. team, squad, section, platoon, company, battalion, regiment, brigade, division, corps, army or army-group.
t When, as an ISO 8601 date or time. A date alone is midnight UTC, and so is a time with no zone.
lon, lat Where.
confidence Optional. confirmed, probable, estimated or approximate. An estimated position is drawn with a dashed frame.
source Where the position comes from. Required.
after_end Optional, on any row of the unit. hide makes the unit leave the map after its last position (sunk, landed, destroyed); hold keeps it there.
status Optional. damaged or destroyed at this position. The symbol shows it from this position on, so repeat it on later rows for as long as it holds.
radius_m Optional. How far off this position may be, in metres. A dashed ring of that size is drawn round the symbol and grows or shrinks between positions.
alt_of Optional. The unit_id of another unit: this row is a second source's position for that unit at this time, not a position of its own. See When sources disagree.
source_url, place, note, strength Optional.

Units can cross the 180th meridian. A position is written with longitude from -180 to 180, and a unit between 179 W and 179 E crosses the dateline the short way rather than sweeping through every longitude between them. For --bbox, give west greater than east for a box that crosses it, for example --bbox 170,20,-170,40.

Every row needs a source. A battle map is a claim about what happened, and the person reading it should be able to ask where a symbol came from. The popup shows the source.

Fronts, axes and events have their own small tables. sarkoa orbat template DIR writes an example of each.

Build the files

sarkoa orbat build --orbat orbat.csv --fronts fronts.csv --axes axes.csv --events events.csv \
  --sides allied=friend,axis=hostile --tour --out build

This checks every table first and stops with the line number of anything wrong. It also warns about things that are possible but probably a mistake: a unit that moves faster than anything of its kind could, a unit with a single position, a gap of days with no fix. sarkoa orbat validate does the checking alone.

It writes tracks.geojson, fronts.geojson, axes.geojson, events.geojson, a tour.json with one stop for each event, and battle-style.json with the style blocks to use.

Put it on a map

Upload each GeoJSON file. For the tracks and axes, upload with the time handling off (temporal_mode: off): the symbols and arrows read their own times. Upload fronts and events as timed layers with start and end as the time fields.

Then give the layers their style. In a map document these are two blocks on a layer, both in battle-style.json:

{
  "layerId": "units",
  "assetId": "…",
  "unitStyle": {
    "sideField": "side",
    "sides": { "allied": { "affiliation": "friend" }, "axis": { "affiliation": "hostile" } },
    "kindField": "kind",
    "echelonField": "echelon",
    "labelField": "name",
    "confidenceField": "confidence",
    "position": { "timesField": "times" }
  }
}
{
  "layerId": "axes",
  "assetId": "…",
  "arrowStyle": {
    "reveal": { "startField": "t0", "endField": "t1" },
    "afterEnd": "fade",
    "fadeHours": 12,
    "outlineField": "retreat",
    "impactField": "impact",
    "smooth": true
  }
}

unitStyle draws the layer's features as symbols in the NATO convention: a rectangle for a friendly unit, a diamond for a hostile one, the kind inside and the echelon above. A unit moves between its positions as the slider moves, and stays where it last was unless you set afterEnd to hide (or afterEndField for one unit that was destroyed or surrendered). It shows a small tick for the direction it is heading while it moves.

arrowStyle draws a line layer as arrows: a wide band, as wide on the ground as you set (widthM), ending in a head. The arrow draws on from its tail between its start and end times. After that it stays, fades to a ghost (where the attack went), or goes. A withdrawal, flagged with outlineField, is drawn as a dashed outline. Draw each line in the direction the arrow should point. Give the layer a coloured style by side and the arrows take those colours.

Both blocks replace the layer's own drawing, so a layer takes one of them and not a visualization or flow. Popups, the legend and the timeline still work: add source and confidence to the popup's fields.

Set the map's timeline step to hour so units glide rather than hop a day at a time, and the time zone to the one your sources use so labels read their clock. For a battle decided in minutes, set the step to minute, 5min or 15min: the slider can then stop on 10:22. With a short step, lower the play speed (playbackIntervalMs, as low as 50) or the play button takes hours to cross a day.

Ships and aircraft

A NATO frame says little about a ship. Set "symbols": "silhouette" in unitStyle (or build with --symbols silhouette) and sea and air kinds are drawn as top-down shapes in the side's colour, turned to the course they are steering. A carrier is a flat deck with an island, a battleship has three turrets, a patrol plane a long wing. Ground kinds keep their frames in the same layer.

Three more things help a battle read:

  • Trails. "trailHours": 3 (or --trail-hours 3) draws each unit's path over the last three hours of map time behind it, fading toward the tail. You see where a ship came from without an arrow for every leg.
  • Damage. A status of damaged on a row puts flames on a silhouette (a condition bar on a frame) from that position on; destroyed greys it and crosses it out. Use after_end hide on the last row when it sinks.
  • Strikes. An axis whose kind is attack or counterattack flashes at its head when it lands. "afterEnd": "fade" then removes the arrow over fadeHours of map time, so the arrows of the morning are gone by the afternoon. The build writes both by default; --fade-hours sets how long.

Claims and what is established

How sure a position is and whether a claim is true are different questions. An action report written the same night may place a ship well and still be wrong about what was hit. The axes and events tables take three more columns for this:

Column Meaning
evidence reported, confirmed, disputed or refuted. Leave it empty when you are not saying.
corrected_by The source that disputes or refutes the claim.
corrected_by_url A link to it.

A disputed arrow is drawn hatched and a refuted one cross-hatched, in its side's colour. If it was a strike, its flash is a hollow ring: claimed, not landed. The popup shows the word beside the title and lists the sources under the rows, "Claimed by" and "Corrected by", each with its link.

Keep the claim on the map. What a commander believed at the time is part of the story, and a reader can see both what was said and what later turned out to be the case.

The popup part works on any vector layer, not only these. In a map document it is one block in the layer's popup:

"popupConfig": {
  "enabled": true,
  "titleField": "title",
  "fields": ["body"],
  "evidence": {
    "field": "evidence",
    "sources": [
      { "field": "source", "urlField": "source_url", "label": "Claimed by" },
      { "field": "corrected_by", "urlField": "corrected_by_url", "label": "Corrected by" }
    ]
  }
}

When sources disagree

Two reports sometimes put the same ship in two places at the same hour. Pick the one you trust for the track, and add the other as a row with alt_of set to the unit's id. The build writes disagreements.geojson: a dashed line from the other position to where your track has the unit at that time, with the distance between them and both sources in its popup. Upload it as a timed layer with start and end.

For a position you worked out rather than read (dead reckoning between two fixes, say), give it a radius_m. The ring shows a reader how much to trust it, and it widens the further the unit gets from its last known position if you give later rows a larger radius.

What each side knew

A battle looks different from each side. A sightings table says who saw whom, when, and where they thought it was:

Column Meaning
observer The side doing the seeing: one of the side values in the units table.
unit_id The unit that was seen.
t When.
lon, lat Optional. Where the sighting report put it. Leave both empty to use where the unit really was.
name, kind Optional. What the observer took it for ("Ten enemy surface ships").
source Where the sighting is reported. Required.

Build with --sightings sightings.csv. The tracks file then holds each observer's picture as well as the full one: an observer always has its own units, and another side's unit appears when first sighted, sits where the report put it, and jumps when it is sighted again. The style file gains a "View as" control. Put it in the map's visitor controls (spec.interactions) with the tracks layer as its target, and a visitor can switch between everything and what one side knew.

Not only battles

sarkoa tracks is the same command under an everyday name. The group column is the side column, shapes are the default, and the style file is called tracks-style.json:

sarkoa tracks template ferry
sarkoa tracks build --tracks ferry/tracks.csv --axes ferry/axes.csv --events ferry/events.csv \
  --groups ferry=neutral --tour --out build

The kinds vessel, aircraft, vehicle, train, person, animal and storm each have a shape. Everything above applies: a planned route as an arrow beside the track that was sailed, a forecast position with its radius, a report that turned out to be wrong marked as refuted.

The clock, play speed and running totals

Three settings on the map's timeline help any map with a time slider:

  • "clock": "visible" shows the selected time large at the top of the map, so it can be read while the map plays.
  • "playbackRate": 600 sets the play speed in seconds of map time for each second of playing (600 is ten minutes a second). It needs a fixed step such as minute or hour, and it saves tuning the step and the interval against each other.
  • "totals" adds up to three running totals under the clock. Each counts a layer's features whose time has passed, or sums one of their attributes: { "label": "Aircraft lost", "layerId": "losses", "timeField": "start", "valueField": "aircraft" }.

In the map builder

A vector layer in the builder has two panels, Moving symbols and Arrows. Turn one on, pick the attributes from the layer's own list (the group, the kind, the label, the times), choose a look for each group, and the preview redraws as you go. The preview has no clock, so it shows every symbol at the end of its track and every arrow whole. Save, and the hosted map plays it.

Open sea and bare ground

A battle in mid-ocean has nothing under it to read position from. sarkoa orbat reference writes a reference layer to put beneath the battle:

sarkoa orbat reference --bbox 168,22,-170,37 --graticule 2 \
  --rings "Midway,-177.35,28.2,100,200,300" --ring-unit nm \
  --place "Midway Atoll,-177.35,28.2" --out build

reference-lines.geojson holds a labelled graticule, the antimeridian when the box crosses it, and range rings round a point (in km, nm or mi); reference-places.geojson holds the named points. Upload them as ordinary layers, style the lines thin and grey, and label them with the label and name fields. Lines that cross 180° are split there, so they draw correctly.

Tell the story with a tour

tour.json is an ordinary map tour with one stop for each event. A zoom column in the events table sets how close that stop goes in. Each stop moves the clock to the event, and with timeTo and playMs it then plays time on to the next event before it moves the camera again:

{
  "view": { "centerLng": 5.7184, "centerLat": 50.0035, "zoom": 9 },
  "title": "Bastogne is cut off",
  "time": "1944-12-20T19:00:00Z",
  "timeTo": "1944-12-22T12:00:00Z",
  "playMs": 6000
}

Visitors can pause the tour, skip to a stop, or take the slider themselves, and the tour stops where it is. Anyone who prefers reduced motion sees each stop at its end time instead of watching the clock run.

Apply it with sarkoa map tour add MAP --id bulge --title "The battle" --stops-file build/tour.json.

With agents

The same blocks work through the MCP server: update_map with updateLayer and a patch holding unitStyle or arrowStyle, and set_tour with time_to and play_ms. An agent can build the tables from research and run the command above. Ask it to keep a source on every row and to leave out any position the source does not give.

Limits

  • Silhouettes are types, not classes: every carrier looks the same. Military ground units have no silhouette.
  • Running totals and the "View as" control read the layer's features in the browser, like units and arrows do.
  • Units and arrows read the layer's source GeoJSON in the browser, so the 32 MiB source limit of the feature query applies.
  • A line is drawn straight between two positions. Add positions for a road that bends.
  • The symbols are the standard set above. Other kinds draw as a plain ground unit.
  • Units and arrows work in 2D, in terrain view and on the globe, and print with the map.