TTakeScreenshotOptions: {
    captureMarkers?: (element: HTMLElement) => Promise<HTMLCanvasElement>;
    withLabels?: boolean;
    withOutdoorContext?: boolean;
}

Options for taking a screenshot.

Type declaration

  • OptionalcaptureMarkers?: (element: HTMLElement) => Promise<HTMLCanvasElement>

    Optional. Function to capture HTML marker elements as canvas. When provided with withLabels, also includes markers in the screenshot.

    If the returned canvas is tainted (contains cross-origin images without CORS), the marker layer will be skipped and the screenshot will still succeed.

    To include all content, ensure:

    • Use useCORS: true in html2canvas options
    • Images have proper CORS headers (Access-Control-Allow-Origin)
    • Use scale: window.devicePixelRatio for crisp output
    • Set backgroundColor: null for transparency
    captureMarkers: (el) => html2canvas(el, {
    backgroundColor: null,
    scale: window.devicePixelRatio,
    useCORS: true,
    })
  • OptionalwithLabels?: boolean

    Whether to include map labels in the screenshot.

    false
    
  • OptionalwithOutdoorContext?: boolean

    Whether to include the outdoor context in the screenshot.

    false