One palette, one way to read an affiliation, and the obstacle family finished.
Breaking, in a minor — a deliberate call, matching how 1.7.0 shipped. Seven
symbols leave the public API and two config fields go with them. A caret range
picks this up automatically, so read the removals before upgrading.
Removed:
LIGHT_MODE_PALETTE, DARK_MODE_PALETTE, paletteForMode
getLabelBackgroundFill, getLabelBackgroundFillOverride
getSelectionFillColor, getSelectionFillColorOverride
config fields: labelBackgroundFill, selectionFillColor
The two palettes and the function that chose between them collapse into one
DEFAULT_PALETTE. The library cannot see your basemap -- or your projector, or
your darkened operations floor -- so it never picks a colour set for you. Keep
whatever sets your app needs and send one:
configureTacticalGraphics(dark ? {...DEFAULT_PALETTE, ...myDark} : DEFAULT_PALETTE)
DEFAULT_PALETTE is also what the renderer's accessors now fall back to, so the
defaults are written down once instead of once per accessor.
labelBackgroundFill rendered nothing -- defined, exported, in both palettes, in
the settings panel, covered by a passing test, and called by no style function.
selectionFillColor did render, but never tracked selection: a translucent blue
fill on every default-styled area graphic, always. Both are gone, and so is the
fill. MAX_LABEL_SIZE comes down from 48 to 26; 48 was picked to mirror the
line-width pair rather than by looking at a map.
Fixed — hostility reached the map only while a human was driving the app:
42 style functions and 4 holders read a graphic's affiliation from the loose
`hostility` / `hostilityColor` feature keys. Those are stamped by the demo's
dialog and sample sweep. writeGraphicProperties -- the documented way to set
amplifiers, and the only way the library itself sets them -- writes
properties.tacticalGraphic and nothing else. So restoreTacticalGraphics brought
every saved hostile graphic back in the neutral default, and the README's own
example ("strokes turn red") did not work for consumers. Every site now reads
through readHostility / readHostilityColor, bag first, key second. A bag-only
stamp across every graphic that takes the field guards it: 169 of those fail
against the old code.
Added:
DEFAULT_PALETTE root and /openlayers
readHostility, readHostilityColor /openlayers
defaultDrawStyleFunc, drawMarkerStyle /openlayers
The draw marker now applies to every graphic. drawMarkerColor and
drawMarkerOutlineColor previously reached one family -- the point-anchored
graphics were the only ones whose controller styled its own draw; everything
else fell through to OpenLayers' built-in editing style, which is hardcoded and
blind to the config.
Graphics — the obstacle family is done, taking the supported count to 207:
obstacle belt, obstacle group, obstacle zone
obstacle free area, obstacle restricted area, obstacle line
Their teeth no longer follow the order the corners were clicked: an apex is
placed 90 degrees off the direction of travel, and which side of travel is the
outside of a polygon depends on the winding, which nothing normalises. Drawn
clockwise the teeth pointed out; drawn the other way every one pointed in.
The obstacle line's label sits under the centre-most drawn segment, clears the
teeth at any zoom -- they are map-unit sized and grow as you zoom in, so a
fixed pixel offset buried the label two levels in -- and holds a proportional
distance to the line rather than drifting as the map scales. The obstacle free
and restricted areas take a name and both DTGs, stacked as FM 1-02.2 draws
them, with the free area's FREE above the designation.
DTGs are written with a two-digit year (021200ZJUN26), per FM 1-02.2 and the
README's own documented example. The parser still reads the four-digit form, so
graphics saved before this open with their dates intact.
562 tests, typecheck clean, build clean including the assertion that the root
entry point imports no OpenLayers.