A layer to display a simple mask with a cut-out box in the middle.

Hierarchy (View Summary)

Index

Constructors

Properties

context: CanvasRenderingContext2D
size: null | [number, number] = null

Methods

  • Draws a mask with a cut-out box shape on the map canvas context.

    Parameters

    • canvasWidth: number

      The width of the canvas.

    • canvasHeight: number

      The height of the canvas.

    • box_ul: [number, number]

      The [x, y] coordinates of the upper-left corner of the cut-out box.

    • box_ur: [number, number]

      The [x, y] coordinates of the upper-right corner of the cut-out box.

    • box_lr: [number, number]

      The [x, y] coordinates of the lower-right corner of the cut-out box.

    • box_ll: [number, number]

      The [x, y] coordinates of the lower-left corner of the cut-out box.

    Returns void

  • Draw the mask.

    Parameters

    • frameState: FrameState

    Returns HTMLCanvasElement

  • Updates the box size (width, height), in pixel, of the mask.

    Parameters

    • size: [number, number]

    Returns void

  • Parameters

    • totalWidth: number
    • totalHeight: number
    • boxWidth: number
    • boxHeight: number

    Returns [[number, number], [number, number], [number, number], [number, number]]