Skip to main content

Type Alias: MosaicLayerProps<MosaicT, DataT>

MosaicLayerProps<MosaicT, DataT> = CompositeLayerProps & Pick<TileLayerProps, "extent" | "maxCacheByteSize" | "maxCacheSize" | "maxRequests" | "maxZoom" | "minZoom"> & object

Defined in: packages/deck.gl-geotiff/src/mosaic-layer/mosaic-layer.ts:22

Type Declaration​

concurrencyLimiter?​

optional concurrencyLimiter?: ConcurrencyLimiter | null

Caps concurrent HTTP requests for this layer's source fetches.

Defaults to a maximum of 6 concurrent requests per origin, which aligns with browser limits of 6 HTTP/1.1 requests per origin. If your sources support HTTP/2 or HTTP/3, you may want to increase this limit or disable it entirely by passing null.

getSource?​

optional getSource?: (source, opts) => Promise<DataT>

Fetch data for this source.

Parameters​

source​

MosaicT

opts​
concurrencyLimiter?​

ConcurrencyLimiter | null

The layer's current concurrencyLimiter prop. Forward to GeoTIFF.fromUrl's concurrencyLimiter option so this source's fetches join the shared per-origin queue.

getPriority?​

() => Priority

Callback that provides dynamic priority for fetches related to this source.

This is designed to re-sort the limiter's queue on viewport pan, preferring sources closer to the viewport center.

signal?​

AbortSignal

Returns​

Promise<DataT>

onSourceError?​

optional onSourceError?: (source, info) => void

Called when fetching a source's data fails.

Parameters​

source​

MosaicT

info​
error​

Error

Returns​

void

onSourceLoad?​

optional onSourceLoad?: (source, info) => void

Called after a source's data has loaded successfully. data is the value returned by getSource, or undefined when no getSource was supplied.

Parameters​

source​

MosaicT

info​
data?​

DataT

Returns​

void

onSourceUnload?​

optional onSourceUnload?: (source, info) => void

Called when a source is evicted from the tile cache.

Parameters​

source​

MosaicT

info​
data?​

DataT

Returns​

void

onViewportLoad?​

optional onViewportLoad?: (entries) => void

Called when all sources currently in the viewport have finished loading.

Parameters​

entries​

object[]

Returns​

void

renderSource​

renderSource: (source, opts) => Layer | LayersList | null

Render a source

Parameters​

source​

MosaicT

opts​
data?​

DataT

signal?​

AbortSignal

Returns​

Layer | LayersList | null

sources​

sources: MosaicT[]

List of mosaic sources to render.

The mosaic updates reactively when this prop is replaced with a new array reference. Mutating the array in place will not trigger an update — pass a fresh array (e.g. [...sources, newItem]) to add or remove items.

Tile cache reuse depends on stable tile IDs. By default, each source's tile ID is derived from its position in this array (see MosaicSource.id), so:

  • Appending items preserves all existing rendered tiles.
  • Reordering or removing items from the middle of the array invalidates the cache slots of shifted items, causing them to re-fetch.

Supply an explicit id per source if you need cache stability across arbitrary mutations of sources.

Type Parameters​

MosaicT​

MosaicT extends MosaicSource = MosaicSource

DataT​

DataT = any