On this page

Type Alias SymbolProjectionContext

type SymbolProjectionContext = {
    getElevation: (x: number, y: number) => number;
    height: number;
    lineVertexArray: SymbolLineVertexArray;
    pitchedLabelPlaneMatrix: mat4;
    pitchWithMap: boolean;
    projectionCache: ProjectionCache;
    tileAnchorPoint: Point;
    transform: IReadonlyTransform;
    translation: [number, number];
    unwrappedTileID: UnwrappedTileID;
    width: number;
}
Index

Properties

getElevation: (x: number, y: number) => number

Function to get elevation at a point

Type Declaration

    • (x: number, y: number): number
    • Parameters

      • x: number

        the x coordinate

      • y: number

        the y coordinate

      Returns number

height: number

Viewport height.

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?
SDK JS
Reference
SymbolProjectionContext