For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Class ProgramConfiguration
Constructors
constructor
- new ProgramConfiguration(
layer: TypedStyleLayer,
zoom: number,
filterProperties: (_: string) => boolean,
): ProgramConfigurationParameters
- layer: TypedStyleLayer
- zoom: number
- filterProperties: (_: string) => boolean
Returns ProgramConfiguration
Methods
defines
Returns string[]
destroy
Returns void
getBinderAttributes
Returns string[]
getBinderUniforms
Returns string[]
getMaxValue
Parameters
- property: string
Returns number
getPaintVertexBuffers
Returns VertexBuffer[]
getUniforms
Parameters
- context: Context
- locations: UniformLocations
Returns BinderUniform[]
populatePaintArrays
Parameters
- newLength: number
- feature: Feature
- options: PaintOptions
Returns void
setConstantDashPositions
setConstantPatternPositions
Parameters
- posTo: ImagePosition
- posFrom: ImagePosition
Returns void
setUniforms
- setUniforms(
context: Context,
binderUniforms: BinderUniform[],
properties: any,
globals: GlobalProperties,
): voidParameters
- context: Context
- binderUniforms: BinderUniform[]
- properties: any
- globals: GlobalProperties
Returns void
updatePaintArrays
- updatePaintArrays(
featureStates: FeatureStates,
featureMap: FeaturePositionMap,
vtLayer: VectorTileLayerLike,
layer: TypedStyleLayer,
options: PaintOptions,
): booleanParameters
- featureStates: FeatureStates
- featureMap: FeaturePositionMap
- vtLayer: VectorTileLayerLike
- layer: TypedStyleLayer
- options: PaintOptions
Returns boolean
updatePaintBuffers
Parameters
Optionalcrossfade: CrossfadeParameters
Returns void
upload
Parameters
- context: Context
Returns void
Internal
ProgramConfiguration contains the logic for binding style layer properties and tile layer feature data into GL program uniforms and vertex attributes.
Non-data-driven property values are bound to shader uniforms. Data-driven property values are bound to vertex attributes. In order to support a uniform GLSL syntax over both, the shaders define a
#pragmaabstraction, which ProgramConfiguration is responsible for implementing. At runtime, it examines the attributes of a particular layer, combines this with fixed knowledge about how layers of the particular type are implemented, and determines which uniforms and vertex attributes will be required. It can then substitute the appropriate text into the shader source code, create and link a program, and bind the uniforms and vertex attributes in preparation for drawing.When a vector tile is parsed, this same configuration information is used to populate the attribute buffers needed for data-driven styling using the zoom level and feature property data.