Class CircleBucket<Layer>
Type Parameters
- Layer extends CircleStyleLayer | HeatmapStyleLayer
Hierarchy (View Summary)
- CircleBucket
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
- new CircleBucket<Layer extends CircleStyleLayer | HeatmapStyleLayer>(
options: BucketParameters<Layer>,
): CircleBucket<Layer>Type Parameters
- Layer extends CircleStyleLayer | HeatmapStyleLayer
Parameters
- options: BucketParameters<Layer>
Returns CircleBucket<Layer>
Properties
hasDependencies
hasDependencies: boolean
index
index: number
indexArray
indexBuffer
layerIds
layerIds: string[]
layers
layoutVertexArray
layoutVertexBuffer
overscaling
overscaling: number
programConfigurations
segments
stateDependentLayerIds
stateDependentLayerIds: string[]
stateDependentLayers
uploaded
uploaded: boolean
zoom
zoom: number
Methods
addFeature
- addFeature(
feature: BucketFeature,
geometry: Point[][],
index: number,
canonical: CanonicalTileID,
granularity?: CircleGranularity,
): voidParameters
- feature: BucketFeature
- geometry: Point[][]
- index: number
- canonical: CanonicalTileID
Optionalgranularity: CircleGranularity
Returns void
destroy
Release the WebGL resources associated with the buffers. Note that because buckets are shared between layers having the same layout properties, they must be destroyed in groups (all buckets for a tile, or all symbol buckets).
Returns void
isEmpty
Returns boolean
populate
- populate(
features: IndexedFeature[],
options: PopulateParameters,
canonical: CanonicalTileID,
): voidParameters
- features: IndexedFeature[]
- options: PopulateParameters
- canonical: CanonicalTileID
Returns void
update
- update(
states: FeatureStates,
vtLayer: VectorTileLayerLike,
imagePositions: { [_: string]: ImagePosition },
): voidParameters
- states: FeatureStates
- vtLayer: VectorTileLayerLike
- imagePositions: { [_: string]: ImagePosition }
Returns void
upload
Parameters
- context: Context
Returns void
uploadPending
Returns boolean
Was this helpful?
Hidden
The
Bucketinterface is the single point of knowledge about turning vector tiles into WebGL buffers.Bucketis an abstract interface. An implementation exists for each style layer type. Create a bucket via theStyleLayer.createBucketmethod.The concrete bucket types, using layout options from the style layer, transform feature geometries into vertex and index data for use by the vertex shader. They also (via
ProgramConfiguration) use feature properties and the zoom level to populate the attributes needed for data-driven styling.Buckets are designed to be built on a worker thread and then serialized and transferred back to the main thread for rendering. On the worker side, a bucket's vertex, index, and attribute data is stored in
bucket.arrays: ArrayGroup. When a bucket's data is serialized and sent back to the main thread, is gets deserialized (usingnew Bucket(serializedBucketData), with the array data now stored inbucket.buffers: BufferGroup. BufferGroups hold the same data as ArrayGroups, but are tuned for consumption by WebGL.