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

Alleviate tile gaps in chromium by using mix-blend-mode CSS #8891

Merged
merged 2 commits into from Mar 27, 2023

Conversation

IvanSanchez
Copy link
Member

This alleviates the dreaded tile gaps of #3575, in a clean way, with no downsides that I'm aware of.

The tile gaps are still visible if the page zoom is not 100%, however (see #3575 (comment)).

Credit goes to @lapo-luchini (see #3575 (comment)).

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
@Falke-Design Falke-Design added this to the 1.9.x milestone Mar 27, 2023
Copy link
Member

@Falke-Design Falke-Design left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should cherry pick to v1 this and ship it with 1.9.4 too

Copy link
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally and it seems to indeed resolve the issue in Chrome.

Co-authored-by: Jon Koops <jonkoops@gmail.com>
@IvanSanchez IvanSanchez merged commit 0392b7f into main Mar 27, 2023
4 checks passed
@IvanSanchez IvanSanchez deleted the mix-blend-mode branch March 27, 2023 18:04
@joeberkovitz
Copy link

I cherry-picked this CSS change to apply for a project that uses Leaflet 1.8 and it created problems with the colors of overlying markers. I don't know if anyone's tested this in combination with markers based on SVG file-based icons but it might be a good idea to verify that it doesn't break them.

@IvanSanchez
Copy link
Member Author

@joeberkovitz Could you please open a bug report with that info? I haven't done throughout testing, but if you can provide a minimal test case where colours of overlaying markers are affected, that'd be very useful.

@joeberkovitz
Copy link

@IvanSanchez I've opened bug #8905 which demonstrates the issue. It turns out to need a more refined test case than just straight-up markers, it requires a custom GridLayer displaying vector point data using SVG icons from adjacent tiles where the icons (not the tiles) overlap. I've explained why I think this is a valid use case in the bug.

@mhirsch
Copy link

mhirsch commented Jul 18, 2023

This does not seem to work in Firefox, and also has the side effect of making the "overlap" fix from #3575 fail, since the overlapped border is lightened.

@jonkoops
Copy link
Collaborator

@mhirsch please report this as a new issue with some steps to reproduce it.

@and-rej
Copy link

and-rej commented Sep 6, 2023

Please note this CSS property has a performance cost associated with it.

Our client uses virtualised desktops that don't have access to a GPU and we lost 10-20 FPS when we upgraded to Leaflet 1.9.4. Took me a while to trace it back to this, but fortunately it's easy to override the style and turn this off. We've never noticed the issue it's supposed to address.

You should be able to see it for yourself. Just turn off hardware acceleration in your browser settings, show the dev tools FPS meter, and pan a map around. Toggle the CSS property between plus-lighter and normal and you should see a difference in FPS.

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

Successfully merging this pull request may close these issues.

None yet

6 participants