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

Background map and blend modes #83

Closed
wahlatlas opened this issue Jan 5, 2023 · 5 comments
Closed

Background map and blend modes #83

wahlatlas opened this issue Jan 5, 2023 · 5 comments
Assignees

Comments

@wahlatlas
Copy link

Do I understand correctly that part of the perfomance trick gridviz does is, that everything in the viewport is rendered into one canvas element at once and that there are no distinct layers that could be styled individually by css?

I am asking this because background maps can greatly benefit from blend modes, as you can see in this example (1km grid, Census 2011 population counts, mix-blend-mode: multiply)

hd_blenmode_1km_pop_grid

and I was wondering if this could be achieved with gridviz

@jgaffuri
Copy link
Contributor

@jgaffuri
Copy link
Contributor

jgaffuri commented Aug 20, 2023

It is now handled in version 2.0.49 !
See the example: https://eurostat.github.io/gridviz/examples/blending_alpha.html

It is now possible to specify something like:

   alpha: 0.75,
   blendOperation: "multiply"

at style or layer definition level.

@jgaffuri
Copy link
Contributor

I just published a little change in version 2.0.50: The alpha and blendOperation parameters are now functions of the zoom factor parameter zf:

   alpha: (zf) => 0.75,
   blendOperation: (zf) => "multiply"

In such a way, it may be possible to alter the alpha depending on the zoom level, to make a fading effect for example...

@wahlatlas
Copy link
Author

wahlatlas commented Sep 11, 2023

This looks great in Chrome and Safari but gives me a black page in Firefox (102.14esr on Windows10; 117.0 on macOS 13.5.2) once I mouseover the map

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