core/shapePayload¶
Interfaces¶
ShapeLike¶
Defined in: core/shapePayload.ts:15
Minimal structural requirement for a shape payload entry.
Properties¶
lat?¶
Defined in: core/shapePayload.ts:16
lon?¶
Defined in: core/shapePayload.ts:17
ShapePayloadResult¶
Defined in: core/shapePayload.ts:20
Type Parameters¶
T¶
T extends ShapeLike
Properties¶
validShapes¶
Defined in: core/shapePayload.ts:22
Shapes that passed lat/lon validation, in payload order.
skipped¶
Defined in: core/shapePayload.ts:24
Labels of entries that failed validation (dict key or array index).
isEmpty¶
Defined in: core/shapePayload.ts:26
True when the payload was an empty/invalid dictionary envelope.
dictNames¶
Defined in: core/shapePayload.ts:33
All names present in a dictionary envelope (even empty or invalid entries), or null for the legacy single/array formats. The dictionary envelope carries the node's complete shape set, so a stored shape missing from this list was deleted server-side.
Functions¶
normalizeShapeColor()¶
Defined in: core/shapePayload.ts:48
Normalize a shape colour to a CSS color string.
BlueSky publishes shape colours as [r, g, b] arrays of 0-255 ints (the COLOUR command in bluesky/tools/areafilter.py), but the client Shape types declare CSS strings. Rendering happened to work only because MapLibre's to-color coercion silently accepts 0-255 arrays; anything else consuming these fields as the strings they claim to be (CSS, canvas) would break. Convert at the payload boundary so stored shapes match their types. Returns undefined for absent or malformed values, letting callers fall back to the display-option defaults.
Parameters¶
color¶
unknown
Returns¶
string | undefined
hasValidLatLon()¶
Defined in: core/shapePayload.ts:63
A shape is renderable only when it carries non-empty lat AND lon arrays.
Parameters¶
shape¶
unknown
Returns¶
shape is ShapeLike
parseShapePayload()¶
Defined in: core/shapePayload.ts:73
Normalize any of the three payload formats into a flat list of valid shapes plus the labels of the entries that failed validation.
Type Parameters¶
T¶
T extends ShapeLike
Parameters¶
data¶
unknown