Knowledge Base Article

Troubleshooting Google Maps widget blank PDF export in Sisense environment [Windows and Linux]

This article addresses an issue where dashboards in Sisense that use a Google Maps widget render correctly in the web interface but appear blank in PDF exports. The problem is typically related to delayed initialization of the Google Maps API and/or incomplete domain whitelisting in the Google API key configuration—especially when rendering occurs in a headless or sandboxed browser context. This guide provides step-by-step instructions to identify and resolve this issue.

Step-by-Step Guide

1. Understanding the Issue

  • Symptom: The Google Maps widget appears blank in exported PDFs.
  • Root Cause: The widget fails to render in time due to:
    • Delayed initialization of the Google Maps API in a headless browser (used by the Sisense export service)
    • Google Maps API restrictions are blocking the request due to missing or non-standard referrer headers

2. Confirm the Behavior

  • Test the export in multiple environments (e.g., test vs. production).
  • Confirm that other widgets render correctly and only the map is blank.
  • Use the browser console and network tab to capture any errors or blocked requests related to maps.googleapis.com.

3. Adjust the Initialization Delay

  • Some third-party Google Maps widgets (like custom plugins) allow for configurable delay before the DOM is marked "ready."
  • If available, increase the initialization delay setting:
    • Start with 5000 ms (5 sec) and incrementally test up to 20000 ms (20 sec) as needed.
  • This ensures the Google Maps object is fully rendered before the export process captures the page.

4. Whitelisting Domains

  • Go to: Google Cloud Console > APIs & Services > Credentials
  • Locate the API key used for Google Maps
  • Under Application Restrictions, choose HTTP referrers (websites)
  • Add your Sisense domain, such as:
https://yourdomain.com/*
  • Ensure there are no typos or missing protocol values (e.g., https:// is required)

5. If Wildcard Whitelisting (*) Works — What Else to Consider

If adding * to your Google Maps API key's HTTP referrer restrictions resolves the issue, it indicates that the export process is calling the Maps API from a referrer that is not currently listed.

To avoid leaving * in place (which poses a security risk), consider whitelisting the following patterns that are often used during headless rendering:

Referrer Pattern

Explanation

chrome-extension://*

Covers Chrome extension contexts often used by headless Chromium during export

file:///*

Covers sandboxed or local rendering cases

localhost or 127.0.0.1

Applies if rendering occurs via a local service

blob:*

Applies in rare cases where export engines use blob URLs internally

Recommendation:

  1. In Google Cloud Console, edit the API key.
  2. Try adding:
    chrome-extension://*
    Re-test the PDF export.
  3. If successful, remove * and retain only the necessary trusted origins.

6. Debugging and Logs Collection

  • Capture HAR files while loading the dashboard and triggering the export to inspect Maps API requests.
  • Collect the following Sisense logs:
    • export
    • plugins
    • api-gateway
    • external-plugin
  • Look for:
    • API errors from maps.googleapis.com
    • Missing or failed resource loads
    • PDF rendering errors in export logs

7. Retest the Export

  • After applying the delay and referrer configuration changes:
    • Re-export the dashboard to PDF
    • Confirm the Google Map widget appears correctly
  • If successful, disable any debug logging to reduce noise

Conclusion

The most common causes of blank Google Maps widgets in PDF exports are:

  1. Map rendering delay in headless environments
  2. Missing or blocked API calls due to improper referrer whitelisting

By adjusting the domReadyDelay (if available) and adding chrome-extension://* to your allowed referrers in Google Cloud Console, you can typically resolve this issue without compromising API key security.

References/Related Content

By following this guide, you should be able to effectively troubleshoot and resolve issues related to blank PDF exports of Google Maps widgets within the Sisense platform. If further assistance is needed, consider reaching out to Sisense support or your system administrator for additional troubleshooting.

=======

Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.

Published 08-13-2025
No CommentsBe the first to comment