ui/map/MapDisplay¶
Classes¶
MapDisplay¶
Defined in: ui/map/MapDisplay.ts:31
MapDisplay - Core map functionality
Handles MapLibre GL map initialization, base map management, and map style selection. This is the foundation for the radar display, providing the canvas for aircraft and other visualizations.
Constructors¶
Constructor¶
Defined in: ui/map/MapDisplay.ts:78
Constructor
Parameters¶
containerId?¶
string = 'map'
The ID of the HTML element to contain the map
Returns¶
Methods¶
initialize()¶
Defined in: ui/map/MapDisplay.ts:92
Initialize the map Creates and configures the MapLibre GL map instance
Returns¶
void
changeMapStyle()¶
Defined in: ui/map/MapDisplay.ts:305
Change the map style (delegates to MapStyleManager)
Parameters¶
styleUrl¶
string
URL of the new map style
Returns¶
void
setupStyleSelector()¶
Defined in: ui/map/MapDisplay.ts:312
Wire the settings-modal style selector (delegates to MapStyleManager)
Returns¶
void
toggleProjection()¶
Defined in: ui/map/MapDisplay.ts:322
Toggle map projection between mercator and globe
Returns¶
void
getProjection()¶
Defined in: ui/map/MapDisplay.ts:345
Get the current projection type
Returns¶
"mercator" | "globe"
getMap()¶
Defined in: ui/map/MapDisplay.ts:352
Get the MapLibre GL map instance
Returns¶
Map$1 | null
getMapTheme()¶
Defined in: ui/map/MapDisplay.ts:363
Classify the active basemap as 'light' or 'dark' so overlays (e.g. the navdata renderer) can pick a palette that reads well against it. The known dark styles are the bundled offline-dark style, Dark Matter, and the OpenFreeMap dark/fiord styles; everything else (Positron, Bright, Liberty, MapTiler, custom URLs) uses the light palette.
Returns¶
"light" | "dark"
isInitialized()¶
Defined in: ui/map/MapDisplay.ts:374
Check if map is initialized
Returns¶
boolean
resize()¶
Defined in: ui/map/MapDisplay.ts:382
Resize the map Should be called when the container size changes
Returns¶
void
getCenter()¶
Defined in: ui/map/MapDisplay.ts:456
Get the map center
Returns¶
[number, number]
setCenter()¶
Defined in: ui/map/MapDisplay.ts:465
Set the map center
Parameters¶
lng¶
number
lat¶
number
zoom?¶
number
Returns¶
void
getZoom()¶
Defined in: ui/map/MapDisplay.ts:479
Get the current zoom level
Returns¶
number
setZoom()¶
Defined in: ui/map/MapDisplay.ts:487
Set the zoom level
Parameters¶
zoom¶
number
Returns¶
void
zoomIn()¶
Defined in: ui/map/MapDisplay.ts:495
Zoom in by one level
Returns¶
void
zoomOut()¶
Defined in: ui/map/MapDisplay.ts:503
Zoom out by one level
Returns¶
void
panTo()¶
Defined in: ui/map/MapDisplay.ts:511
Pan to a specific location (animated)
Parameters¶
lat¶
number
lon¶
number
Returns¶
void
getCurrentBounds()¶
Defined in: ui/map/MapDisplay.ts:520
Get current map bounds Returns [west, south, east, north] for MCRE commands
Returns¶
number[] | null
fitBounds()¶
Defined in: ui/map/MapDisplay.ts:533
Fit the map to bounds
Parameters¶
bounds¶
[[number, number], [number, number]]
options?¶
FitBoundsOptions
Returns¶
void
onStyleChange()¶
Defined in: ui/map/MapDisplay.ts:542
Set a callback to be invoked when the map style changes
Parameters¶
callback¶
() => void
Function to call when style loads
Returns¶
void
onBeforeStyleChange()¶
Defined in: ui/map/MapDisplay.ts:552
Set a callback to be invoked right before every style swap starts (map.setStyle is about to be called), so listeners can tear down layers they attached to the outgoing style's sources first.
Parameters¶
callback¶
() => void
Function to call before the style change
Returns¶
void
setMapLoadCallback()¶
Defined in: ui/map/MapDisplay.ts:560
Set a callback to be invoked when the map finishes loading
Parameters¶
callback¶
() => void
Function to call when map loads
Returns¶
void
destroy()¶
Defined in: ui/map/MapDisplay.ts:572
Destroy the map and clean up resources
Returns¶
void