UNPKG

@zxh19890103/wik

Version:

The world-class JavaScript library for building large-scale digital warehouse both on 2D and 3D.

38 lines (37 loc) 1.33 kB
import L from 'leaflet'; import { ReactiveLayer } from '../../mixins'; import { Constructor } from '../../interfaces'; export type ImageLayerDataSource = HTMLImageElement | HTMLCanvasElement; declare const ImageLayer_base: Constructor<L.Polygon<any> & ReactiveLayer>; export declare class ImageLayer extends ImageLayer_base { private imgSrc; protected image: ImageLayerDataSource; protected width: number; protected height: number; /** * If you need to draw bound. */ protected needDrawBound: boolean; constructor(imgSrc: string | ImageLayerDataSource, width: number, height: number); setImage(imgSrc: string | ImageLayerDataSource, draw?: boolean): void; getImage(): ImageLayerDataSource; showBounds(show?: boolean): void; onTransform(): void; /** * @see https://web.dev/canvas-performance/ * * I cannot inspect the performance improvement */ _updatePath(): void; } export interface ImageLayer { _renderer: L.Canvas; _pxBounds: L.Bounds; readonly __DEFAULT_IMAGE__: ImageLayerDataSource; } interface SetDefaultImageOptions { offscreenCanvas: boolean; scale: number; } export declare function setDefaultImage<T extends ImageLayer>(C: Constructor<T>, src: string, options?: SetDefaultImageOptions): Promise<unknown>; export {};