/** * PopupLayer (spec: "PopupLayer (built-in ``)"). * Dense, WebGL-rendered geo-annotations — a deck.gl CompositeLayer, not a * DOM system. deck.gl's own TextLayer already renders a background rect * behind its glyphs (`background`/`getBackgroundColor`/`backgroundBorderRadius`/ * `backgroundPadding`), which covers "quad geometry for backgrounds" without * hand-rolling a separate polygon layer — one TextLayer per layout, not a * multi-layer composition. * * `layout="card"`'s subtext is folded into `getText` as a second line (`\n`) * rather than a second stacked TextLayer, so both lines share ONE background * box instead of two overlapping ones — a deliberate simplification. * * `getIcon` is accepted in the schema (forward-compatible with the spec's * accessor list) but not yet wired to an IconLayer sub-layer — that needs an * icon atlas/mapping the spec's own example doesn't exercise, so it's an * honest, documented gap rather than a half-built icon system. */ import { CompositeLayer } from "@deck.gl/core"; import { TextLayer } from "@deck.gl/layers"; export type PopupLayout = "badge" | "pin-label" | "card"; export interface PopupLayerProps { data: unknown[]; layout?: string; minZoom?: number; maxZoom?: number; pickable?: boolean; visible?: boolean; getPosition: (d: unknown) => [number, number] | [number, number, number]; getText: (d: unknown) => string; getSubtext?: ((d: unknown) => string) | null; getColor?: unknown; getSize?: unknown; /** * Overrides the layout's default `[x, y]` screen-pixel offset. Not * attribute-exposed (an internal escape hatch, set via `patchAnimatedProps` * — same non-string-prop-injection precedent as a SimpleMeshLayer's * `mesh`) — the volume gizmo's elevation tooltip uses this so it clears * the gizmo mesh by a CONSTANT pixel gap at every zoom, which a world-space * (meters) offset can't do: at low zoom a fixed meter offset shrinks to * fewer pixels than the badge itself needs, causing exactly the overlap a * real user reported. */ pixelOffset?: [number, number]; /** Raw WebGL/GPU state passthrough (e.g. `{ depthTest: false }`) — same internal escape hatch as `pixelOffset`, not attribute-exposed. */ parameters?: Record; updateTriggers?: Record; } export declare class PopupLayer extends CompositeLayer { static layerName: string; static defaultProps: { layout: string; minZoom: number; maxZoom: number; pickable: boolean; getPosition: { type: string; value: (d: unknown) => [number, number]; }; getText: { type: string; value: () => string; }; getSubtext: { type: string; value: null; }; getColor: { type: string; value: number[]; }; getSize: { type: string; value: number; }; }; renderLayers(): TextLayer | null; }