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

Ability to modify the map background #4036

Open
chrisgervang opened this issue Apr 24, 2024 · 1 comment
Open

Ability to modify the map background #4036

chrisgervang opened this issue Apr 24, 2024 · 1 comment

Comments

@chrisgervang
Copy link

User Story

As a designer, I can set the clearColor to something other than transparent so that the horizon color in exported images isn't "black" or "transparent" when camera pitch is set to high values.

Rationale

This is very useful for a basic sky implementation. While there is a sky spec coming along, a solid color sky is a considerably simpler and desirable solution for minimalistic map styles.

Our workaround today is to patch the maplibre node module with a reassigned clear color. There is no top level map parameter to modify WebGL parameters.

While setting the DOM background color works when compositing in-browser, it is insufficient when compositing the canvas to an image.

Of note, I'm a deck.gl user that uses the @deck.gl/mapbox submodule to perform interleaved rendering. Deck.gl provides a parameters property to override WebGL parameters, however Maplibre is overriding my settings.

I see at least two possible solutions, either a new map option to set the background color (ideal), or an option to disable maplibre's behavior of setting clearColor.

Impact

The impact of doing nothing is the image exports will look different than what the end user sees in the browser.

@HarelM
Copy link
Member

HarelM commented Apr 24, 2024

I believe there's a sky branch already which you can use as a intermediate workaround.
There's no point in adding a option which will be redundant.
Another option is to use afork or patch-paxkage to solve your issue until things land here.
Also you can help out push the sky spec and implementation forward, as there's no real stopper besides people who actually needs this.

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