utils/maplibre¶
Variables¶
DRAWING_CURSOR¶
Defined in: utils/maplibre.ts:20
Canvas cursor used by every interactive map-drawing mode (console map picker, shape/route drawing, aircraft creation). Centralised here so all drawing modes share one consistent pointer. Assign the empty string to restore MapLibre's default cursor when leaving a drawing mode.
Functions¶
ensureGeoJSONSource()¶
Defined in: utils/maplibre.ts:22
Parameters¶
map¶
Map$1
sourceId¶
string
extra?¶
Omit\<SourceSpecification & object, "type" | "data">
Returns¶
void
ensureLayer()¶
Defined in: utils/maplibre.ts:35
Parameters¶
map¶
Map$1
spec¶
LayerSpecification
beforeId?¶
string
Returns¶
void
updateSourceFeatures()¶
Defined in: utils/maplibre.ts:44
Parameters¶
map¶
Map$1
sourceId¶
string
features¶
Feature\<Geometry, GeoJsonProperties>[]
Returns¶
void
setLayerVisibility()¶
Defined in: utils/maplibre.ts:54
Parameters¶
map¶
Map$1
layerId¶
string
visible¶
boolean
Returns¶
void
safeRemoveLayer()¶
Defined in: utils/maplibre.ts:66
Remove a layer if it exists. No-op when missing.
Parameters¶
map¶
Map$1
layerId¶
string
Returns¶
void
safeRemoveSource()¶
Defined in: utils/maplibre.ts:75
Remove a source if it exists. No-op when missing.
Parameters¶
map¶
Map$1
sourceId¶
string
Returns¶
void
buildConditionalColorExpr()¶
Defined in: utils/maplibre.ts:88
Build a MapLibre expression of the form:
['case', ['==', ['get','selected'], true], selected,
['==', ['get','in_conflict'], true], conflict,
normal]
conflict is optional; when omitted the conflict clause is skipped.
Parameters¶
normal¶
string
selected¶
string
conflict?¶
string
Returns¶
ExpressionSpecification
buildConditionalImageExpr()¶
Defined in: utils/maplibre.ts:107
Same shape as buildConditionalColorExpr but meant for image / sprite lookups. Kept as a separate function for readability at call sites.
Parameters¶
normal¶
string
selected¶
string
conflict?¶
string
Returns¶
ExpressionSpecification
isValidCoordinate()¶
Defined in: utils/maplibre.ts:115
Parameters¶
lat¶
unknown
lon¶
unknown
Returns¶
boolean