UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

33 lines (32 loc) 1.66 kB
import type { FrameState } from 'ol/Map'; import Layer from 'ol/layer/Layer'; /** * A layer to display a simple mask with a cut-out box in the middle. */ declare class SimpleMaskLayer extends Layer { protected readonly context: CanvasRenderingContext2D; protected size: [number, number] | null; private readonly fillColor; constructor(options?: {}, color?: string); /** * Updates the box size (width, height), in pixel, of the mask. */ updateSize(size: [number, number]): void; /** * Draw the mask. */ render(frameState: FrameState): HTMLCanvasElement; /** * Draws a mask with a cut-out box shape on the map canvas context. * * @param {number} canvasWidth - The width of the canvas. * @param {number} canvasHeight - The height of the canvas. * @param {[number, number]} box_ul - The [x, y] coordinates of the upper-left corner of the cut-out box. * @param {[number, number]} box_ur - The [x, y] coordinates of the upper-right corner of the cut-out box. * @param {[number, number]} box_lr - The [x, y] coordinates of the lower-right corner of the cut-out box. * @param {[number, number]} box_ll - The [x, y] coordinates of the lower-left corner of the cut-out box. */ drawBoxMask(canvasWidth: number, canvasHeight: number, box_ul: [number, number], box_ur: [number, number], box_lr: [number, number], box_ll: [number, number]): void; static calculateBoxCorners(totalWidth: number, totalHeight: number, boxWidth: number, boxHeight: number): [[number, number], [number, number], [number, number], [number, number]]; } export default SimpleMaskLayer;