For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface AttributeBinder
interface AttributeBinder {
destroy(): void;
populatePaintArray(
length: number,
feature: Feature,
options: PaintOptions,
): void;
updatePaintArray(
start: number,
length: number,
feature: Feature,
featureState: FeatureState,
options: PaintOptions,
): void;
upload(a: Context): void;
}
destroy(): void;
populatePaintArray(
length: number,
feature: Feature,
options: PaintOptions,
): void;
updatePaintArray(
start: number,
length: number,
feature: Feature,
featureState: FeatureState,
options: PaintOptions,
): void;
upload(a: Context): void;
}
Index
Methods
destroy
Returns void
populatePaintArray
Parameters
- length: number
- feature: Feature
- options: PaintOptions
Returns void
updatePaintArray
- updatePaintArray(
start: number,
length: number,
feature: Feature,
featureState: FeatureState,
options: PaintOptions,
): voidParameters
- start: number
- length: number
- feature: Feature
- featureState: FeatureState
- options: PaintOptions
Returns void
upload
Parameters
- a: Context
Returns void
Binderis the interface definition for the strategies for constructing, uploading, and binding paint property data as GLSL attributes. Most style- spec properties have a 1:1 relationship to shader attribute/uniforms, but some require multiple values per feature to be passed to the GPU, and in those cases we bind multiple attributes/uniforms.It has three implementations, one for each of the three strategies we use:
Note that the shader source varies depending on whether we're using a uniform or attribute. We dynamically compile shaders at runtime to accommodate this.