Loader utilities
Give format implementations the same transport primitives.
@loaders.gl/core/loader-utils contains the lower-level contracts used by loaders and sources: random-access files, HTTP ranges, request scheduling, caches, URI resolution, and context-aware parsing.
The loader utility boundary
Normalize transport once. Let each loader focus on its format.
These utilities make remote and local data look alike to a loader, then add the controls needed for large datasets: bounded concurrency, byte-range coalescing, caching, stable references, and parser context.
Files
ReadableFile, ArrayBufferFile, and HttpFile
Requests
Schedulers for concurrency and byte ranges
Caches
Request and exact-range result reuse
Context
URI resolution and nested parser coordination
Detailed guide
Transport and loader-building details
The reference below lists the shared file, request, cache, URI, and context APIs used by format implementations and cloud-native sources.
The @loaders.gl/core/loader-utils contains utilities for creating loaders.
API
-
ReadableFileprovides the common random-access file contract. -
ArrayBufferFileprovides direct random access to in-memory data. -
HttpFilevalidates random-access HTTP reads and remote object identity. -
RequestSchedulerlimits asynchronous request concurrency. -
Numeric raster data defines region, affine, validity and CPU sampling contracts.
-
RangeRequestSchedulercoalesces compatible byte ranges. -
RequestCachededuplicates and bounds ordinary asynchronous request results. -
RangeRequestCachecaches exact and contained byte ranges. -
CachedUriResolverresolves resource references against one stable base and memoizes repeated derivations for a caller-controlled lifetime. -
encodeArrayBufferToBase64encodes binary bytes as padded base64. -
initializeWasmModuleforwards WASM initialization errors and safely extracts Emscripten exports.
Tile-grid normalization
Source implementations can share createTileGrid(crs, matrices), createTileGridMatrix(fields), getRequestedTileMatrix(matrices, getId, parameters), and getTileGridMatrixId(grid, parameters). Grid construction preserves incomplete advertised metadata and exposes complete math.gl geometry only when every level validates. Matrix fields may include resolutionY for vertical pixel size; resolution is horizontal and remains the default for both axes.
Protocol-specific CRS and scale interpretation belongs in source modules. These helpers perform no reprojection, extent-based inference, or source fetching. See Tile matrices and tile matrix sets.
Tile grids
Grid validation and addressing covers complete versus partial metadata, coverage diagnostics and canonical coalesced tile requests.