Skip to content

ui/map/shapes/shapeCommand

Interfaces

ShapePoint

Defined in: ui/map/shapes/shapeCommand.ts:9

A drawn point in {lat, lng} form (BaseDrawingManager's DrawingPoint).

Properties

lat
lat: number;

Defined in: ui/map/shapes/shapeCommand.ts:10

lng
lng: number;

Defined in: ui/map/shapes/shapeCommand.ts:11


ShapeCommandSpec

Defined in: ui/map/shapes/shapeCommand.ts:49

Properties

name
name: string;

Defined in: ui/map/shapes/shapeCommand.ts:50

type
type: ShapeType;

Defined in: ui/map/shapes/shapeCommand.ts:51

points
points: ShapePoint[];

Defined in: ui/map/shapes/shapeCommand.ts:56

The placed points. Areas/lines use all of them; a box is its two opposite corners; a circle is [centre, point-on-rim].

topAltitude
topAltitude: number | null;

Defined in: ui/map/shapes/shapeCommand.ts:58

Top/bottom altitude in feet; both null = no vertical extent.

bottomAltitude
bottomAltitude: number | null;

Defined in: ui/map/shapes/shapeCommand.ts:59

Type Aliases

ShapeType

type ShapeType = "area" | "line" | "circle" | "box";

Defined in: ui/map/shapes/shapeCommand.ts:15

The shape kinds offered by the draw modal.


AltitudeParseResult

type AltitudeParseResult = 
  | {
  ok: true;
  top: number | null;
  bottom: number | null;
}
  | {
  ok: false;
  error: string;
};

Defined in: ui/map/shapes/shapeCommand.ts:17

Functions

parseAltitudeInputs()

function parseAltitudeInputs(topRaw, bottomRaw): AltitudeParseResult;

Defined in: ui/map/shapes/shapeCommand.ts:27

Parse the draw modal's optional top/bottom altitude inputs. Both empty means no vertical extent; anything else needs two finite numbers with top above bottom, so a non-numeric value can't leak into the generated command as NaN and a half-filled pair isn't silently dropped.

Parameters

topRaw

string

bottomRaw

string

Returns

AltitudeParseResult


buildShapeCommand()

function buildShapeCommand(spec): string;

Defined in: ui/map/shapes/shapeCommand.ts:70

Build the BlueSky command for a drawn shape: - line -> POLYLINE name,lat,lon,... - area with alts -> POLYALT name,top,bottom,lat,lon,... - area without alts -> POLY name,lat,lon,... - box -> BOX name,lat0,lon0,lat1,lon1[,top,bottom] - circle -> CIRCLE name,clat,clon,radius_nm[,top,bottom]

Parameters

spec

ShapeCommandSpec

Returns

string