Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Renderer

Renders the original image and markup to a flat raster image.

Hierarchy

  • Renderer

Index

Properties

Optional height

height: number

When set and naturalSize is false sets the height of the rendered image.

Both width and height have to be set for this to take effect.

Optional imageQuality

imageQuality: number

For formats that support it, specifies rendering quality.

In the case of image/jpeg you can specify a value between 0 and 1 (lowest to highest quality).

imageType

imageType: string = "image/png"

Rendered image type (image/png, image/jpeg, etc.).

markersOnly

markersOnly: boolean = false

When set to true, only the marker layer without the original image will be rendered.

naturalSize

naturalSize: boolean = false

Whether the image should be rendered at the original (natural) target image size.

Optional width

width: number

When set and naturalSize is false sets the width of the rendered image.

Both width and height have to be set for this to take effect.

Methods

rasterize

  • rasterize(target: HTMLImageElement, markerImage: SVGSVGElement, targetCanvas?: HTMLCanvasElement): Promise<string>
  • Initiates rendering of the result image and returns a promise which when resolved contains a data URL for the rendered image.

    Parameters

    • target: HTMLImageElement

      target (underlying original) image

    • markerImage: SVGSVGElement

      marker layer

    • Optional targetCanvas: HTMLCanvasElement

    Returns Promise<string>

Generated using TypeDoc