FIMViz.jsAPI
    Preparing search index...

    Interface MapProviderImpl

    interface MapProviderImpl {
        acceptsCRS?: (crs: string) => boolean;
        addRasterImage: (
            map: any,
            dataUrl: string,
            bounds: { east: number; north: number; south: number; west: number },
            opts?: { interactive?: boolean; opacity?: number },
        ) => any;
        addVector: (
            map: any,
            geojson: any,
            opts?: {
                style?:
                    | string
                    | NeutralStyle
                    | ((ctx: { feature: any; index: number }) => string | NeutralStyle);
            },
        ) => any;
        applyLayerOrder?: (map: any, handles: any[]) => any[];
        create: (
            el: Element,
            options: GoogleCreateOptions | LeafletCreateOptions,
        ) => Promise<any>;
        fitBounds: (
            map: any,
            bounds: { east: number; north: number; south: number; west: number },
        ) => void;
        onMapEvent: (
            map: any,
            type:
                | "click"
                | "hover"
                | "dblclick"
                | "mousedown"
                | "mouseup"
                | "rightclick",
            cb: (
                evt: {
                    lat: number;
                    lng: number;
                    originalEvent: MouseEvent;
                    type: string;
                },
            ) => void,
        ) => () => void;
        onMapMouseMove: (
            map: any,
            cb: (pt: { lat: number; lng: number }) => void,
        ) => () => void;
        removeRasterImage: (map: any, handle: any) => void;
        removeVector: (map: any, handle: any) => void;
        requiresApiKey?: boolean;
        setDraggable?: (map: any, on: boolean) => void;
        setRasterImageOpacity: (handle: any, opacity: number) => void;
        setRasterImageUrl: (
            map: any,
            handle: any,
            dataUrl: string,
            bounds: { east: number; north: number; south: number; west: number },
            opts?: { interactive?: boolean; opacity?: number },
        ) => any;
        viewMetrics?: (
            map: any,
        ) => { height: number; metresPerPixel: number; width: number };
        whenIdle?: (map: any, opts?: { timeout?: number }) => Promise<void>;
    }
    Index
    acceptsCRS?: (crs: string) => boolean

    can this provider render content in crs? Asked by Layer's render precondition before drawing. Omitted = permissive (accepts anything).

    addRasterImage: (
        map: any,
        dataUrl: string,
        bounds: { east: number; north: number; south: number; west: number },
        opts?: { interactive?: boolean; opacity?: number },
    ) => any

    position a pre-rendered image (data URL or any image URL) over bounds; returns an opaque raster-image handle. Non-interactive (clickable:false) by default so map events pass through to the engine's own hit-testing; pass { interactive: true } to opt this overlay into direct SDK interaction.

    addVector: (
        map: any,
        geojson: any,
        opts?: {
            style?:
                | string
                | NeutralStyle
                | ((ctx: { feature: any; index: number }) => string | NeutralStyle);
        },
    ) => any

    render a GeoJSON FeatureCollection/Feature onto map; returns an opaque vector handle.

    applyLayerOrder?: (map: any, handles: any[]) => any[]

    restack overlays to match handles, ordered bottom → top, and RETURN the handles: a provider may have replaced some (the Google raster path recreates them), so callers must adopt the returned array.

    create: (
        el: Element,
        options: GoogleCreateOptions | LeafletCreateOptions,
    ) => Promise<any>

    build the map in el; returns the provider's native map object (exposed as fim.map).

    fitBounds: (
        map: any,
        bounds: { east: number; north: number; south: number; west: number },
    ) => void

    fit the map's viewport to bounds.

    onMapEvent: (
        map: any,
        type:
            | "click"
            | "hover"
            | "dblclick"
            | "mousedown"
            | "mouseup"
            | "rightclick",
        cb: (
            evt: {
                lat: number;
                lng: number;
                originalEvent: MouseEvent;
                type: string;
            },
        ) => void,
    ) => () => void

    subscribe to a normalized map event; returns an unsubscribe function. hover maps to the provider's mousemove equivalent.

    onMapMouseMove: (
        map: any,
        cb: (pt: { lat: number; lng: number }) => void,
    ) => () => void

    subscribe to mouse-move on the map, normalized to {lat, lng}; returns an unsubscribe function.

    removeRasterImage: (map: any, handle: any) => void

    tear a raster-image handle down.

    removeVector: (map: any, handle: any) => void

    tear a vector handle down.

    requiresApiKey?: boolean

    does create() need options.apiKey? (google: true, leaflet: false)

    setDraggable?: (map: any, on: boolean) => void

    turn pan-by-drag on or off. Drag-based selection tools suppress it while drawing, because tracing a stroke and panning the map are the same gesture.

    setRasterImageOpacity: (handle: any, opacity: number) => void

    change a raster-image handle's opacity (0..1).

    setRasterImageUrl: (
        map: any,
        handle: any,
        dataUrl: string,
        bounds: { east: number; north: number; south: number; west: number },
        opts?: { interactive?: boolean; opacity?: number },
    ) => any

    swap a raster-image handle's image (e.g. a palette repaint). The caller MUST use the RETURNED handle going forward — some providers (google) cannot swap the image in place and recreate the overlay instead.

    viewMetrics?: (
        map: any,
    ) => { height: number; metresPerPixel: number; width: number }

    ground metres per screen pixel, plus the map's pixel size. What lets a tool be sized in SCREEN units (a brush that stays the same width as you zoom) without ever touching a map SDK.

    whenIdle?: (map: any, opts?: { timeout?: number }) => Promise<void>

    resolve once the camera has settled. Safe to await unconditionally: it resolves on a timeout when the map is already still, so it can never hang. Anything that reads the projection right after a fitBounds must await this first — a click resolved mid-animation lands at the wrong coordinates.