browser-image
    Preparing search index...

    Options for LoadImageControl.

    interface LoadImageControlOptions {
        layer?: Layer<Source, LayerRenderer<any>, { [x: string]: any }>;
        sourceOptions?: Omit<EnhancedGeoTIFFOptions, "sources">;
        fit?: boolean;
        url?: boolean;
        drop?: boolean;
        accept?: string;
        placement?: (
            size: { width: number; height: number },
            map: Map,
        ) => ImagePlacement;
        labels?: Partial<LoadImageLabels>;
        css?: boolean;
        className?: string;
        target?: string | HTMLElement;
        onFiles?: (files: File[]) => void;
        onOpen?: () => void;
        onUrl?: (url: string) => boolean | Promise<boolean>;
        onLoad?: (loaded: LoadedImage) => void;
        onError?: (error: unknown, name: string) => void;
    }
    Index
    layer?: Layer<Source, LayerRenderer<any>, { [x: string]: any }>

    The layer that shows the image: each loaded image becomes its source (the previous source is disposed). Without it, use onLoad to show the source.

    sourceOptions?: Omit<EnhancedGeoTIFFOptions, "sources">

    Options for the new EnhancedGeoTIFF. By default the pipeline of the layer's previous source is kept, and tiles are left as read when the layer is a GpuCorrectedTileLayer with WebGL2 (the layer corrects them), else corrected in workers. Images deeper than 8 bits (16-bit, float) are read raw (normalize: 'auto') and stretched band by band from their own values, cutting 2 % at each end like QGIS's default (rawStretch: { lowPercent: 2, highPercent: 2 }). YCbCr (JPEG-compressed imagery), CMYK and CIELab images are converted to RGB (convertToRGB: 'auto').

    fit?: boolean

    Zoom the map to the loaded image (default true).

    url?: boolean

    Show the button for a COG URL (default true).

    drop?: boolean

    Accept files dropped on the map (default true).

    accept?: string

    The file chooser's accept. Default: TIFF files and images.

    placement?: (
        size: { width: number; height: number },
        map: Map,
    ) => ImagePlacement

    Where an ordinary picture (one without georeferencing) goes. Default: centered on the view, 80 % of its size, keeping the picture's shape.

    labels?: Partial<LoadImageLabels>

    Texts; missing keys come from loadImageLabelsEn. loadImageLabelsJa has Japanese.

    css?: boolean

    Add the default styles to the document (default true).

    className?: string

    Extra class names for the control element.

    target?: string | HTMLElement

    Put the control in this element instead of the map's overlay container.

    onFiles?: (files: File[]) => void

    Takes the files chosen or dropped instead of the control: the chooser then accepts several files at once, and the handler decides what to open (for example call loadFile for each image and read other files itself).

    onOpen?: () => void

    Called instead of the file chooser when the open button is pressed, for choosing files another way (for example showOpenFilePicker, to keep the file handles). Call LoadImageControl.openChooser to fall back to the chooser, and loadFile or your onFiles with the files chosen.

    onUrl?: (url: string) => boolean | Promise<boolean>

    Takes a URL entered in the URL form first, for URLs that are not COGs (an image service, say): return (or resolve with) true when it was opened another way, false to load it as a COG. A rejection keeps the form open.

    onLoad?: (loaded: LoadedImage) => void

    Called after an image is loaded (also fired as a load event).

    onError?: (error: unknown, name: string) => void

    Called when an image cannot be loaded (also fired as an error event).