import type { WebGLContextManager } from "../webgl/context-manager"; import type { PlotLayout } from "../layout/plot-layout"; import type { TileSource } from "./tile-source"; type GL = WebGL2RenderingContext | WebGLRenderingContext; /** * Renders an XYZ raster tile basemap into the chart's webgl canvas * inside the plot rect's scissor. Used by `MapChart` from inside * `renderInPlotFrame`, before the glyph draw, so chart glyphs (point, * line, density) composite naturally on top of the basemap. * * The layer owns: * - The tile shader program (compiled once per WebGL context). * - A unit-quad corner buffer (one 2-byte attribute, reused per * tile). * - A `TileCache` (LRU of `WebGLTexture`). * - A `TileLoader` (async fetch + dedup). * * On each render: pick the integer zoom that matches the requested * meters-per-pixel, enumerate visible tiles at that zoom, and draw * each one — either with the loaded texture or with a parent * texture's sub-rect while the target is in flight. */ export declare class TileLayer { private _program; private _cornerBuffer; private _cache; private _loader; private _source; private _alpha; private _onTileLoad; /** * Hook the "tile arrived" notification through to the chart's * render scheduler. Called once when the layer is constructed * by `MapChart`. */ setOnTileLoad(cb: () => void): void; /** * Swap the tile source (e.g. light ↔ dark theme). Drops the cache * because the cached textures came from the prior source's URLs. */ setSource(gl: GL, source: TileSource): void; setAlpha(alpha: number): void; get source(): TileSource | null; /** * Render the basemap for the current visible Mercator extent. * Caller is responsible for binding the chart's main framebuffer * (the plot-frame scissor is already in place by the time we get * here). The same `projection` matrix the glyph draw uses is * passed straight through. */ render(glManager: WebGLContextManager, layout: PlotLayout, projection: Float32Array, domain: { xMin: number; xMax: number; yMin: number; yMax: number; }, xOrigin: number, yOrigin: number): void; /** * Free every GPU resource. Called from `MapChart.destroyInternal`. */ destroy(gl: GL): void; private _drawTile; private _issueDraw; private _kickLoad; private _ensureProgram; } export {};