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

Overlay transparency #213

Closed
Phyks opened this issue Jun 25, 2019 · 4 comments
Closed

Overlay transparency #213

Phyks opened this issue Jun 25, 2019 · 4 comments
Milestone

Comments

@Phyks
Copy link
Contributor

Phyks commented Jun 25, 2019

Hi,

I'm currently using an overlay map to show the noise in the streets in Paris (https://tiles.phyks.me/bruitparif/{z}/{x}/{y}.png). Sadly, this overlay is not semi-transparent (it is fully colored, without any alpha level).

I guess this is not the only map one would like to overlay which does not have an alpha channel. What about adding a setting to let user change opacity of the overlays (just the same as what is currently done for the route opacity).

This could be useful as well for very dense overlays, such as the Mapillary coverage in urban areas.

Thanks!

@nrenner
Copy link
Owner

nrenner commented Jun 30, 2019

I started testing blending modes a while ago with the idea to use for the route and overlays, in the hope that it might look better overall and the route/overlay might be less pale than with reducing opacity alone:

http://plnkr.co/edit/2n3YEksk1QBz8VjxGf2r?p=preview

This is setting mix-blend-mode CSS style on the overlay layer container. Mode multiply is probably most helpful, not sure about the others, also depends on the background layer.

But not sure yet if this would be useful in addition to an opacity slider.

@Phyks
Copy link
Contributor Author

Phyks commented Jul 1, 2019

I'd say that an opacity slider is the simplest (both from coding and usage) control on this.

Having the control on blending mode could be super useful indeed, but probably a more technical (for the user in particular)? A typical use case would be to have a nice render of relief with a relief overlay (which is usually done with a multiply operation). I did not know we could do it with CSS and Leaflet!

@nrenner
Copy link
Owner

nrenner commented Jul 6, 2019

The blending control in this form is just meant for testing. Most probably would be just a "blending" checkbox using multiply mode. But that would be a separate feature and also not really that helpful for the bruitparif layer, so just adding opacity slider now is fine.

@Phyks
Copy link
Contributor Author

Phyks commented Aug 4, 2019

Closing this one as #215 has been merged.

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

No branches or pull requests

3 participants