Skip to content

API reference / @zaes/tactical-graphics/openlayers / MissionTaskGraphicBase

Class: MissionTaskGraphicBase ​

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:144

Extended by ​

Implements ​

  • MissionTaskGraphic

Constructors ​

Constructor ​

ts
new MissionTaskGraphicBase(
   name, 
   size, 
   drawingResolution?
): MissionTaskGraphicBase;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:173

Parameters ​

name ​

TacticalGraphicName

size ​

number

drawingResolution? ​

number

Returns ​

MissionTaskGraphicBase

Properties ​

base ​

ts
base: Feature<LineString | Point>;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:157

The center the graphic is built around, and — since it is now published from getFeatures() — the only part of a mission task that has to survive a save. Everything else regenerates from it plus size / rotation.

base is deliberately left false. That flag means "has vertices the Modify interaction may drag" (getRenderedFeaturesByProp('base')), which a point-anchored graphic does not: it is reshaped by rotate / resize / translate. Same trick as mobileDefense in controllerRegistry.ts. The role tag, not this flag, is what identifies the feature when serializing.

Implementation of ​

ts
MissionTaskGraphic.base

center ​

ts
center: Coordinate;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:145

The point the graphic is built around. Declared alongside size and rotation because the three together are the whole of a point-anchored graphic's editable state — which is exactly what save/restore has to carry.

Implementation of ​

ts
MissionTaskGraphic.center

centerHandle ​

ts
centerHandle: Feature<MultiPoint>;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:164

The center dot — visual anchor only.

See ​

publishHandles


graphic ​

ts
graphic: Feature;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:165


handles ​

ts
handles: Feature<MultiPoint>;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:162


label ​

ts
label: Feature;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:170


measure ​

ts
measure: Feature;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:169

The radius read-out. Empty unless a gesture is in progress —

See ​

showMeasure.


mirrored ​

ts
mirrored: boolean = false;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:476

Which side an asymmetric point-anchored graphic hangs its hook on — Pursuit's semicircle and P-line. Reflected in the graphic's own local frame, so it survives rotation. Stamped and replayed like any other geometry input.


name ​

ts
name: TacticalGraphicName;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:171

Implementation of ​

ts
MissionTaskGraphic.name

rotation ​

ts
rotation: number = 0;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:158

Implementation of ​

ts
MissionTaskGraphic.rotation

size ​

ts
size: number;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:159

Implementation of ​

ts
MissionTaskGraphic.size

symbolId ​

ts
symbolId: string = '';

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:160

Implementation of ​

ts
MissionTaskGraphic.symbolId

Methods ​

centerCoordinate() ​

ts
centerCoordinate(): Coordinate;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:763

The center, which is holder state rather than something to read back off the base.

It used to come from this.base.getGeometry().getCoordinates(), which is a coordinate for a point base and an array of them for an anchored one — so every style that consumed it silently got a nested array the moment a graphic converted.

Returns ​

Coordinate

Implementation of ​

ts
MissionTaskGraphic.centerCoordinate

getFeatures() ​

ts
getFeatures(): Feature<Geometry, {
[x: string]: any;
}>[];

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:610

Returns ​

Feature<Geometry, { [x: string]: any; }>[]

Implementation of ​

ts
MissionTaskGraphic.getFeatures

setBaseFeature() ​

ts
setBaseFeature(base): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:724

Adopts a new center point.

Used to be this.base = base and nothing else, which left center pointing at the old coordinate: the next rotate or resize — neither passes a center — would read the stale this.center back out and snap the graphic to where it used to be. Mission tasks are kept out of the Modify interaction so nothing reached this in practice, but it is on the public TacticalGraphicHandler interface and the manager calls it by symbolId.

Parameters ​

base ​

Feature<LineString | Point>

Returns ​

void

Implementation of ​

ts
MissionTaskGraphic.setBaseFeature

setMirrored() ​

ts
setMirrored(mirrored): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:479

Parameters ​

mirrored ​

boolean

Returns ​

void

See ​

TacticalGraphicHandler.setMirrored

Implementation of ​

ts
MissionTaskGraphic.setMirrored

setSymbolId() ​

ts
setSymbolId(symbolId): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:706

Parameters ​

symbolId ​

string

Returns ​

void

Implementation of ​

ts
MissionTaskGraphic.setSymbolId

showMeasure() ​

ts
showMeasure(active, anchor?): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:464

Arms or disarms the radius read-out.

Armed by the controller for the duration of a draw or resize gesture and disarmed when it ends, so the hashed line is a live measurement rather than decoration. Off by default, which is what keeps it out of a restored map and out of the sample gallery — both drive updateGeom without any gesture.

Parameters ​

active ​

boolean

anchor? ​

Coordinate

Returns ​

void

Implementation of ​

ts
MissionTaskGraphic.showMeasure

updateGeom() ​

ts
updateGeom(__namedParameters): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:668

Parameters ​

__namedParameters ​
center? ​

Coordinate

rotation? ​

number

size? ​

number

Returns ​

void

Implementation of ​

ts
MissionTaskGraphic.updateGeom

updateGeometry() ​

ts
updateGeometry(): void;

Defined in: components/openlayers/graphics/MissionTaskGraphicBase.ts:331

Returns ​

void

Released under the MIT License.