ui/map/aircraft/Aircraft3DCustomLayer¶
Classes¶
Aircraft3DCustomLayer¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:27
Custom MapLibre layer for 3D aircraft rendering.
Coordinates the scene (projection-specific mesh groups, lighting, per-frame camera updates) and translates aircraft data ticks into fleet operations. Mesh CRUD lives in Aircraft3DFleet; scene-origin and transform math in Aircraft3DTransforms; model loading/caching in Aircraft3DModelLoader.
Extends¶
Constructors¶
Constructor¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:49
Parameters¶
displayOptions¶
stateManager¶
StateManager | null
Returns¶
Overrides¶
Properties¶
id¶
Defined in: ui/map/rendering/CustomLayer3D.ts:26
A unique layer id.
Inherited from¶
type¶
Defined in: ui/map/rendering/CustomLayer3D.ts:27
The layer's type. Must be "custom".
Inherited from¶
renderingMode¶
Defined in: ui/map/rendering/CustomLayer3D.ts:28
Either "2d" or "3d". Defaults to "2d".
Inherited from¶
camera¶
Defined in: ui/map/rendering/CustomLayer3D.ts:30
Inherited from¶
scene¶
Defined in: ui/map/rendering/CustomLayer3D.ts:31
Inherited from¶
renderer¶
Defined in: ui/map/rendering/CustomLayer3D.ts:32
Inherited from¶
map¶
Defined in: ui/map/rendering/CustomLayer3D.ts:33
Inherited from¶
directionalLight1¶
Defined in: ui/map/rendering/CustomLayer3D.ts:36
Inherited from¶
CustomLayer3D.directionalLight1
directionalLight2¶
Defined in: ui/map/rendering/CustomLayer3D.ts:37
Inherited from¶
CustomLayer3D.directionalLight2
Methods¶
onSceneReady()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:75
Called when scene is ready for subclass to add objects Override this to add your 3D objects to the scene
Returns¶
void
Overrides¶
updateAircraft()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:104
Update aircraft with new data
Parameters¶
aircraftData¶
Returns¶
void
onOverridesChanged()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:190
React to changes in the per-aircraft model override map. Rebuilds the mesh for any aircraft whose override value changed.
Parameters¶
newOverrides¶
Record\<string, string>
oldOverrides¶
Record\<string, string>
Returns¶
void
onScaleOverridesChanged()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:225
Re-apply transforms for all aircraft whose scale may have changed. Cheap enough to run on every override change since it just rewrites the transform matrix (no mesh rebuild).
Returns¶
void
updateScene()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:232
Update scene every frame with proper transform matrix
Parameters¶
args?¶
Returns¶
void
Overrides¶
updateDisplayOptions()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:291
Update display options
Parameters¶
options¶
Returns¶
void
updateModelPath()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:303
Update the fallback model path from display options. This path is used for aircraft whose ICAO type is unknown or missing; known types are rendered with their category-specific model.
Returns¶
void
reloadAircraftModel()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:315
Reload aircraft models (invoked when the user changes the fallback model). Clears caches and existing meshes; the next data tick rebuilds everything, each aircraft picking the right per-type model.
Returns¶
void
cleanup()¶
Defined in: ui/map/aircraft/Aircraft3DCustomLayer.ts:336
Cleanup all resources
Returns¶
void
onAdd()¶
Defined in: ui/map/rendering/CustomLayer3D.ts:48
Initialize Three.js scene (called by MapLibre when layer is added)
Parameters¶
map¶
Map$1
MapLibre map instance
gl¶
WebGLRenderingContext | WebGL2RenderingContext
WebGL rendering context
Returns¶
void
Inherited from¶
setupLighting()¶
Defined in: ui/map/rendering/CustomLayer3D.ts:116
Setup scene lighting Override this method to customize lighting for your scene
Returns¶
void
Inherited from¶
render()¶
Call Signature¶
Defined in: ui/map/rendering/CustomLayer3D.ts:144
Render the scene (called by MapLibre every frame)
Parameters¶
gl¶
WebGLRenderingContext | WebGL2RenderingContext
WebGL rendering context
matrix¶
number[]
Transformation matrix (deprecated, use args)
Returns¶
void
Inherited from¶
Call Signature¶
Defined in: ui/map/rendering/CustomLayer3D.ts:145
Render the scene (called by MapLibre every frame)
Parameters¶
gl¶
WebGLRenderingContext | WebGL2RenderingContext
WebGL rendering context
args¶
CustomRenderMethodInput
Returns¶
void
Inherited from¶
lngLatToMercator()¶
Defined in: ui/map/rendering/CustomLayer3D.ts:198
Convert longitude/latitude to Mercator coordinates
Parameters¶
lng¶
number
Longitude in degrees
lat¶
number
Latitude in degrees
altitude?¶
number = 0
Altitude in meters
Returns¶
object
Mercator coordinates and scale factor
x¶
y¶
z¶
scale¶
Inherited from¶
CustomLayer3D.lngLatToMercator
createTransformMatrix()¶
Defined in: ui/map/rendering/CustomLayer3D.ts:228
Create a transformation matrix for positioning an object on the map
Parameters¶
lng¶
number
Longitude in degrees
lat¶
number
Latitude in degrees
altitude¶
number
Altitude in meters
heading?¶
number = 0
Heading in radians (0 = North, clockwise)
pitch?¶
number = 0
Pitch in radians (rotation around X axis)
roll?¶
number = 0
Roll in radians (rotation around Y axis)
scale?¶
number = 1
Additional scale factor
Returns¶
Matrix4
Three.js transformation matrix
Inherited from¶
CustomLayer3D.createTransformMatrix
isGlobeProjection()¶
Defined in: ui/map/rendering/CustomLayer3D.ts:272
Check if the current map projection is globe
Returns¶
boolean
True if globe projection is active
Inherited from¶
CustomLayer3D.isGlobeProjection
onRemove()?¶
Defined in: ui/map/rendering/CustomLayer3D.ts:286
Cleanup when layer is removed (called by MapLibre) Override to cleanup any resources
Parameters¶
_map¶
Map$1
_gl¶
WebGLRenderingContext | WebGL2RenderingContext
Returns¶
void