Skip to content

API reference / @zaes/tactical-graphics / DrawnAnchorFrame

Interface: DrawnAnchorFrame ​

Defined in: tacticalgraphics/core/drawnAnchors.ts:44

Where a drawn-anchor graphic's points go, stated once for both renderers ​

The seven graphics in DRAWN_ANCHOR_GRAPHICS are described by points rather than by a dropped centre, and no two of them lay those points out the same way: Turn spends three on a bow, Envelop four on a run and a half circle, Pursue three on a hook, Ambush three on an arc and an arrow, Contain two on a semicircle's opening.

That layout lived in the OpenLayers holders, one anchorPoints() override each, in the half of the codebase MapLibre cannot see. So MapLibre could not write one: it stored the raw clicks instead and the generator read them as whatever its own reader expected. For Turn that meant the two clicks became the ends of the chord where OpenLayers reads them as centre and edge — the same gesture, the same panel hint, half the symbol. Measured, the same two clicks: 240 x 31 px on OpenLayers, 120 x 24 px on MapLibre.

A frame in, points out. The inverse — points back to a frame — is each shape's own reader in core/anchors.ts (bowFromAnchors, hookFromAnchors, …), which both engines already share; this is the direction that was missing.

See ​

ai/conventions.md, "A symbology fact never lives in a holder"

Properties ​

arrowReach? ​

ts
optional arrowReach?: number;

Defined in: tacticalgraphics/core/drawnAnchors.ts:56

Ambush's arrow reach, as a multiple of the radius.


bend? ​

ts
optional bend?: number;

Defined in: tacticalgraphics/core/drawnAnchors.ts:52

Curve depth, for the two that carry one. Signed: the sign is the side.


center ​

ts
center: Position;

Defined in: tacticalgraphics/core/drawnAnchors.ts:46

The symbol's centre, in lon/lat.


lineRatio? ​

ts
optional lineRatio?: number;

Defined in: tacticalgraphics/core/drawnAnchors.ts:58

Pursuit's straight run, as a multiple of the radius.


mirrored? ​

ts
optional mirrored?: boolean;

Defined in: tacticalgraphics/core/drawnAnchors.ts:54

Which flank an asymmetric symbol hangs on. Pursuit's hook.


rotation? ​

ts
optional rotation?: number;

Defined in: tacticalgraphics/core/drawnAnchors.ts:50

Planar degrees, 0 = east.


size ​

ts
size: number;

Defined in: tacticalgraphics/core/drawnAnchors.ts:48

Half-length in metres — the reach from centre to edge, which is what a draw measures.

Released under the MIT License.