maplibre-gl-svg-sprite - v0.2.0
    Preparing search index...

    Class BaseOpAbstract

    Base class for creating custom post-processing operations

    Extend this class and implement the run method. Instance properties can store state.

    class CustomOp extends BaseOp {
    async run(ctx, w, h, params) {
    ctx.fillStyle = params.color || 'red';
    ctx.fillRect(0, 0, w, h);
    }
    }

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a new operation

      Parameters

      • Optionalid: string

        Optional identifier for debugging

      Returns BaseOp

    Properties

    id?: string

    Unique identifier or descriptive name

    Methods

    • Execute the post-processing operation

      Parameters

      • ctx: CanvasRenderingContext2D

        Canvas 2D rendering context

      • w: number

        Width in CSS pixels

      • h: number

        Height in CSS pixels

      • params: Record<string, string>

        Query parameters from the image request

      Returns void | Promise<void>