Skip to content

ui/map/routes/RouteDrawingPreview

Classes

RouteDrawingPreview

Defined in: ui/map/routes/RouteDrawingPreview.ts:38

RouteDrawingPreview - Temporary map sources and layers for the route drawing preview. Owns all MapLibre state associated with the in-progress draw: placed waypoint markers, connecting line, leader line from the anchor (aircraft or last existing waypoint), and the dashed cursor preview.

The manager feeds it the current route points and leader anchor; this class doesn't hold the drawing state itself.

Constructors

Constructor
new RouteDrawingPreview(mapDisplay, stateManager): RouteDrawingPreview;

Defined in: ui/map/routes/RouteDrawingPreview.ts:42

Parameters
mapDisplay

MapDisplay

stateManager

StateManager

Returns

RouteDrawingPreview

Methods

setup()
setup(): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:56

Set up temporary GeoJSON sources/layers for drawing preview.

Layers: - temp-route-draw-leader: solid line from leader anchor → first waypoint - temp-route-draw-line: solid line connecting placed waypoints - temp-route-draw-preview: dashed line from last waypoint → cursor - temp-route-draw-points + temp-route-draw-labels: numbered markers

Returns

void

updateDrawing()
updateDrawing(routePoints, leaderAnchor): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:129

Update placed waypoint markers, connecting line, and leader line.

Parameters
routePoints

object[]

leaderAnchor

| { lat: number; lng: number; } | null

Returns

void

updateCursor()
updateCursor(
   cursor, 
   routePoints, 
   leaderAnchor): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:163

Update the dashed preview segment. - No waypoints placed yet: preview runs from the leader anchor → cursor so the user can see where their first waypoint will attach. - Otherwise: preview runs from the last placed waypoint → cursor.

Parameters
cursor
lat

number

lng

number

routePoints

object[]

leaderAnchor

| { lat: number; lng: number; } | null

Returns

void

clearCursor()
clearCursor(): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:186

Remove just the dashed cursor-preview segment.

Returns

void

clear()
clear(): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:192

Returns

void

teardown()
teardown(): void;

Defined in: ui/map/routes/RouteDrawingPreview.ts:198

Returns

void