GeoLeaf Core API - v3.19.0
    Preparing search index...

    Variable WorkerManagerConst

    WorkerManager: {
        fetchGeoJSON: (
            url: string,
            layerId: string,
            options?: {
                chunkSize?: number;
                onChunk?: (
                    features: GeoJSONFeature[] | undefined,
                    index?: number,
                    total?: number,
                ) => void;
            },
        ) => Promise<unknown>;
        fetchText: (url: string, layerId: string) => Promise<unknown>;
        isAvailable: () => boolean;
        setWorkerUrl: (url: string | null) => void;
        dispose: () => void;
    } = ...

    Type Declaration

    • fetchGeoJSON: (
          url: string,
          layerId: string,
          options?: {
              chunkSize?: number;
              onChunk?: (
                  features: GeoJSONFeature[] | undefined,
                  index?: number,
                  total?: number,
              ) => void;
          },
      ) => Promise<unknown>

      Fetches and parses GeoJSON through the Web Worker (or the main-thread fallback).

    • fetchText: (url: string, layerId: string) => Promise<unknown>

      Fetches the raw text of a URL through the Web Worker (or the main-thread fallback). Perf 6.3.1: Used for GPX files to offload network from the main thread. Note: DOMParser parsing stays on the main thread — it is not available in every Worker.

    • isAvailable: () => boolean

      Checks whether the Web Worker is available.

    • setWorkerUrl: (url: string | null) => void

      Sets the URL the Worker is built from; null restores the default (see _detectScriptBase).

      Applies to the NEXT construction: a Worker already running keeps its script until it is torn down (idle timeout, dispose(), or an error). An error of that Worker does not condemn the URL set here: only a failure of the URL the next Worker would use sends the later loads to the main thread. A URL set here survives dispose() — it is configuration, not state. Setting one also clears an earlier failure: a Worker error had sent every later load to the main thread, and a new URL is a new attempt.

      For any other value.

    • dispose: () => void

      Terminates the Worker and clears its state. Called during application teardown.