For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface WorkerSource
interface WorkerSource {
availableImages: string[];
removeSource?: (params: RemoveSourceParams) => Promise<void>;
abortTile(params: TileParameters): Promise<void>;
loadTile(params: WorkerTileParameters): Promise<WorkerTileResult>;
reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult>;
removeTile(params: TileParameters): Promise<void>;
}
availableImages: string[];
removeSource?: (params: RemoveSourceParams) => Promise<void>;
abortTile(params: TileParameters): Promise<void>;
loadTile(params: WorkerTileParameters): Promise<WorkerTileResult>;
reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult>;
removeTile(params: TileParameters): Promise<void>;
}
Index
Properties
Methods
Properties
availableImages
availableImages: string[]
OptionalremoveSource
Tells the WorkerSource to abort in-progress tasks and release resources. The foreground Source is responsible for ensuring that 'removeSource' is the last message sent to the WorkerSource.
Methods
abortTile
loadTile
Loads a tile from the given params and parse it into buckets ready to send back to the main thread for rendering. Should call the callback with:
{ buckets, featureIndex, collisionIndex, rawTileData}.Parameters
- params: WorkerTileParameters
Returns Promise<WorkerTileResult>
reloadTile
Re-parses a tile that has already been loaded. Yields the same data as WorkerSource.loadTile.
Parameters
- params: WorkerTileParameters
Returns Promise<WorkerTileResult>
WorkerSourceshould be implemented by custom source types to provide code that can be run on the WebWorkers. Each of the methods has a relevant event that triggers it from the main thread with the relevant parameters.See
Map.addSourceType