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

WorkerSource should 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.

Map.addSourceType

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>;
}
Index

Properties

availableImages: string[]
removeSource?: (params: RemoveSourceParams) => Promise<void>

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

  • Aborts loading a tile that is in progress.

    Parameters

    Returns Promise<void>

  • Removes this tile from any local caches.

    Parameters

    Returns Promise<void>

Was this helpful?