API reference / @zaes/tactical-graphics/openlayers / AirCorridor
Class: AirCorridor
Defined in: components/openlayers/graphics/AirCorridor.ts:12
Extends
Constructors
Constructor
new AirCorridor(
name,
offset,
resolution?
): AirCorridor;Defined in: components/openlayers/graphics/AirCorridor.ts:13
Parameters
name
offset
number
resolution?
number = 0
Returns
AirCorridor
Overrides
MovementGraphicBase.constructor
Properties
base
base: Feature<LineString>;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:66
Inherited from
features
features: Feature<Geometry, {
[x: string]: any;
}>[] = [];Defined in: components/openlayers/graphics/MovementGraphicBase.ts:72
Inherited from
gestureResolution
gestureResolution: number | undefined;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:80
The live resolution for one gesture.
See
LineGraphicBase.gestureResolution
Inherited from
MovementGraphicBase.gestureResolution
graphic
graphic: Feature;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:67
Inherited from
graphicLabels
graphicLabels: GraphicLabels;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:62
Inherited from
MovementGraphicBase.graphicLabels
graphicName
graphicName: TacticalGraphicName;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:74
Inherited from
MovementGraphicBase.graphicName
handles
handles: Feature;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:69
Inherited from
hidesStartHandle?
optional hidesStartHandle?: boolean;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:76
See
LineGraphic.hidesStartHandle — set by LineGraphicController.
Inherited from
MovementGraphicBase.hidesStartHandle
labels
labels: Feature;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:68
Inherited from
mirrored
mirrored: boolean = false;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:96
Which side an asymmetric movement graphic hangs its arrow on — MobileDefense's, which leaves from one of the two ellipse arcs. Driven by the sign of the same offset drag that sets the width.
See
TacticalGraphicHandler.setMirrored
Inherited from
offset
offset: number;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:61
Inherited from
offsetHandle
offsetHandle: Feature;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:70
Inherited from
MovementGraphicBase.offsetHandle
offsetScale
offsetScale: number = 1;Defined in: components/openlayers/graphics/AirCorridor.ts:28
The perpendicular distance from the corridor center-line to a width handle IS the circle radius, so the radius must track the cursor 1:1 for the handle to stay under it. The shared default halves that distance, which is right for graphics whose offset is a full width rather than a radius.
Overrides
MovementGraphicBase.offsetScale
resolution
resolution: number;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:77
Inherited from
MovementGraphicBase.resolution
shapingFromGesture
shapingFromGesture: boolean = false;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:83
Set around the gestures that author geometry.
See
LineGraphicBase.shapingFromGesture
Inherited from
MovementGraphicBase.shapingFromGesture
symbolId
symbolId: string = '';Defined in: components/openlayers/graphics/MovementGraphicBase.ts:73
Inherited from
Methods
currentOffset()
currentOffset(): number | undefined;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:451
The half-width a width drag starts from, so the manager's latched delta begins where the graphic already is rather than where the cursor happens to have grabbed.
Reads the stored coordinate for the eleven, and this.offset for everything else.
Returns
number | undefined
See
TacticalGraphicsManager.handleOffset
Inherited from
MovementGraphicBase.currentOffset
getBaseGraphicFeature()
getBaseGraphicFeature(): Feature<LineString>;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:276
Returns
Feature<LineString>
Inherited from
MovementGraphicBase.getBaseGraphicFeature
getFeatures()
getFeatures(): Feature<Geometry, {
[x: string]: any;
}>[];Defined in: components/openlayers/graphics/MovementGraphicBase.ts:457
Returns
Feature<Geometry, { [x: string]: any; }>[]
Inherited from
MovementGraphicBase.getFeatures
setBaseFeature()
setBaseFeature(base): void;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:305
The one door every base change comes through, so it is where the width point is put back square.
LineGraphicController.settle does this for the graphics that drag their own vertices, and this family does not — so an edit that reached the base another way left the point wherever the cursor dropped it. Measured on the running app before this: a 90 px vertical drag on an avenue of approach's grip moved the stored point straight up and left its longitude untouched, where MapLibre — which normalizes inside buildTacticalGraphic, on every build — had already squared it onto the arrowhead's corner. The two engines stored different coordinates for the same gesture.
Guarded on the predicate rather than run for the whole family, because everything else this holder draws has a base whose every coordinate is a route point and nothing to square.
Parameters
base
Feature<LineString>
Returns
void
See
normalizeDrawnBase, carriesWidthPointInBase
Inherited from
MovementGraphicBase.setBaseFeature
setLabel()
setLabel(labels): void;Defined in: components/openlayers/graphics/AirCorridor.ts:74
Editing WIDTH in the Feature Properties dialog resizes the corridor, the mirror of dragging a width handle. The guard compares against the string this graphic would print for its current geometry, so the write that setOffset makes never loops back in here as a resize.
An unparseable value (a unit we don't read, e.g. feet) is stored as typed and leaves the geometry alone — better a label we didn't act on than a corridor silently resized from a misread number.
Parameters
labels
Returns
void
Overrides
setLabelStyle()
setLabelStyle(name): void;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:148
Parameters
name
Returns
void
Inherited from
MovementGraphicBase.setLabelStyle
setMirrored()
setMirrored(mirrored): void;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:99
Parameters
mirrored
boolean
Returns
void
See
TacticalGraphicHandler.setMirrored
Inherited from
MovementGraphicBase.setMirrored
setOffset()
setOffset(offset): void;Defined in: components/openlayers/graphics/AirCorridor.ts:102
A width drag rewrites the WIDTH amplifier too, so the label can never contradict the drawn shape. Any value typed into the dialog is replaced — the geometry is the source of truth for this one field.
Doctrinally this is amplifier AM ("a numeric amplifier that displays a minimum, maximum, or specific distance (including range, radius, width, or length) in meters or feet", FM 1-02.2 line 7409). It is NOT W — in this template W/W1 carry the corridor's date-time group, which is what the separate start/end date fields hold.
Parameters
offset
number
Returns
void
Overrides
setSketchBase()
setSketchBase(base): void;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:367
A base that is still a run of clicks, which is what the draw interaction hands over on every pointer move until the last one.
For the eleven axis arrows the two are not the same thing. Their last stored coordinate is the width, so a sketch arriving through setBaseFeature has the point under the cursor read as a width and the one before it as the tip: the preview lost a click's worth of axis and drew an arrow pinched to whatever the cursor happened to be off the line. Measured mid-draw at three clicks, the previewed half-width ran between a few metres and a few hundred where the committed symbol's was 4,684.
Here every click is an axis point and the width is seeded, which is the same reading MapLibre's preview has always taken — drawBase seeds through axisBaseFromDraw and previewDraw and the commit both come through it. The half-width is the same 20 screen pixels, spent at the first click's latitude the way MapLibre spends it, so the two engines place one width point from one set of clicks rather than two that agree to within a percent.
Parameters
base
Feature<LineString>
Returns
void
See
- DEFAULT_AXIS_HALF_WIDTH_PX
Everything else this holder draws has a base whose every coordinate is a route point, so a sketch and a base really are the same array and this falls through.
- LineGraphic.setSketchBase, axisBaseFromDraw
Inherited from
MovementGraphicBase.setSketchBase
setSymbolId()
setSymbolId(symbolId): void;Defined in: components/openlayers/graphics/MovementGraphicBase.ts:280
Parameters
symbolId
string
Returns
void
Inherited from
MovementGraphicBase.setSymbolId
updateGeometry()
updateGeometry(): void;Defined in: components/openlayers/graphics/AirCorridor.ts:30
Returns
void