ui/map/navdata/NavaidSnapper¶
Classes¶
NavaidSnapper¶
Defined in: ui/map/navdata/NavaidSnapper.ts:33
NavaidSnapper - shared helper that lets the drawing/creation tools snap a clicked coordinate to the nearest visible navaid (airport, heliport or waypoint).
The navdata is a queryable MapLibre vector source (see NavdataRenderer), so we just probe the rendered point layers in a small pixel box around the cursor and pick the closest hit. queryRenderedFeatures already skips layers whose visibility is 'none', so toggling a navaid type off in Display Options also removes it as a snap target for free.
A single instance is shared by ShapeDrawingManager, RouteDrawingManager and AircraftCreationManager, and also drives a hover highlight (ring + ident label) so the user can see what a click will snap to before committing.
Constructors¶
Constructor¶
Defined in: ui/map/navdata/NavaidSnapper.ts:54
Parameters¶
mapDisplay¶
stateManager¶
getMinAirportRank¶
(zoom) => number
Returns¶
Methods¶
snap()¶
Defined in: ui/map/navdata/NavaidSnapper.ts:73
Find the nearest snappable navaid to the cursor, or null if snapping is off or nothing is within range.
Parameters¶
e¶
MapMouseEvent
Returns¶
SnapResult | null
highlight()¶
Defined in: ui/map/navdata/NavaidSnapper.ts:129
Update the hover highlight to mark the navaid the cursor would snap to. Shows a ring + ident label when a candidate is found, hides it otherwise.
Parameters¶
e¶
MapMouseEvent
Returns¶
void
clearHighlight()¶
Defined in: ui/map/navdata/NavaidSnapper.ts:150
Hide the highlight (keeps the layers around for the next hover).
Returns¶
void
teardown()¶
Defined in: ui/map/navdata/NavaidSnapper.ts:160
Remove highlight layers + source entirely.
Returns¶
void
Interfaces¶
SnapResult¶
Defined in: ui/map/navdata/NavaidSnapper.ts:11
Result of a successful snap: the navaid coordinate plus its identity so callers can use the precise position (and, in future, the ICAO/ident name).
Properties¶
lng¶
Defined in: ui/map/navdata/NavaidSnapper.ts:12
lat¶
Defined in: ui/map/navdata/NavaidSnapper.ts:13
ident¶
Defined in: ui/map/navdata/NavaidSnapper.ts:14
kind¶
Defined in: ui/map/navdata/NavaidSnapper.ts:15