For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Type Alias SymbolProjectionContext

Arguments necessary to project a vertex to the label plane

type SymbolProjectionContext = {
    getElevation: GetElevation | undefined;
    height: number;
    heightAnchorGround?: boolean;
    heightOffset?: number;
    lineVertexArray: SymbolLineVertexArray;
    pitchedLabelPlaneMatrix: mat4;
    pitchWithMap: boolean;
    projectionCache: ProjectionCache;
    tileAnchorPoint: Point;
    transform: IReadonlyTransform;
    translation: [number, number];
    unwrappedTileID: UnwrappedTileID;
    width: number;
}
Index

Properties

getElevation: GetElevation | undefined

Function to get elevation at a point, absent when the map has no terrain

the x coordinate

the y coordinate

height: number

Viewport height.

heightAnchorGround?: boolean

Whether symbol-height-anchor is ground, so that heightOffset is measured from the terrain surface rather than from the zero elevation datum. Defaults to true.

heightOffset?: number

The evaluated symbol-height-offset of the symbol being projected, in meters. Defaults to 0.

lineVertexArray: SymbolLineVertexArray

The array of tile-unit vertices transferred from worker

pitchedLabelPlaneMatrix: mat4

Matrix for transforming from pixels (symbol shaping) to potentially rotated tile units (pitched map label plane).

pitchWithMap: boolean

True when line glyphs are projected onto the map, instead of onto the viewport.

projectionCache: ProjectionCache

Used to cache results, save cost if projecting the same vertex multiple times

tileAnchorPoint: Point

Only for creating synthetic vertices if vertex would otherwise project behind plane of camera, but still convenient to pass it inside this type.

translation: [number, number]

Translation in tile units, computed using text-translate and text-translate-anchor paint style properties.

unwrappedTileID: UnwrappedTileID
width: number

Viewport width.

Was this helpful?