@ml2drender/wasm
    Preparing search index...

    Interface InitOptions

    Options of MapRenderer.init.

    interface InitOptions {
        loadResource?: (url: string) => Promise<Uint8Array<ArrayBuffer> | null>;
        wasm?: Module;
        cache?: { ttlMs?: number };
    }
    Index
    loadResource?: (url: string) => Promise<Uint8Array<ArrayBuffer> | null>

    Load complete resource bytes, or null for a missing resource (HTTP 404). Other failures must reject.

    wasm?: Module

    Precompiled WASM (required on Cloudflare Workers). Defaults to the bundled asset in browsers.

    cache?: { ttlMs?: number }

    Decoded resources (tiles and their layer geometry, sprites, glyphs) are kept inside the renderer and reused by later renders; the first render ttlMs or more after they started being kept drops them. 0 disables reuse, Infinity never expires. Default: 5 minutes. With 0, a render also drops each layer bucket once drawn, which lowers its peak memory (e.g. on Cloudflare Workers, whose 128 MB includes WASM memory, which never shrinks). Fetched bytes are not cached: rely on the HTTP cache, or cache in loadResource.

    Type Declaration

    • OptionalttlMs?: number

      Milliseconds; 0 or Infinity included. Default: 300 000 (5 minutes).