Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set preserveDrawingBuffer to true in MapLibreGLLayer #198

Closed
sheeley820 opened this issue Sep 13, 2023 · 1 comment
Closed

Set preserveDrawingBuffer to true in MapLibreGLLayer #198

sheeley820 opened this issue Sep 13, 2023 · 1 comment

Comments

@sheeley820
Copy link
Contributor

Describe the problem

Due to a quirk in Firefox discussed in this thread WebGL based Maps do not print properly in Firefox. However, as mentioned in this comment setting preserveDrawingBuffer to true resolves the issue. I have confirmed this to be true by adding it to the options passed into the maplibregl object. (See image)

I know there are some performance concerns associated with setting this to true. Are those significant enough to block users from printing maps in Firefox?

image

Describe the proposed solution

Add preserveDrawingBuffer: true to line 159 in src/MaplibreGLLayer.js, which would add it to the options passed into the _glMap on line 162.

Alternatives considered

Allowing a user to set this in the options they pass to VectorBasemapLayer and VectorTileLayer and keep it false by default unless set to true by the user. However, if this is the case I think there should be something in the README that calls out this printing issue in Firefox. It was not an easy issue to track down. Many thanks to the contributors who helped me.

Additional Information

I received help from the Maplibre folks as well, as seen here. Definitely a team effort and I appreciate all the assistance. Glad to have finally figured out how to fix it.

@sheeley820
Copy link
Contributor Author

I have created a PR to resolve this issue.
#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants